File src/gurobipy/gurobi.pxi:3647, in gurobipy.read() File src/gurobipy/gurobi.pxi:70, in gurobipy.gurobi.read() AttributeError: 'PosixPath' object has no attribute 'find'
回答済みHi,
I meet this error when the program call grb.read() inside a pytorch.geometric dataloader. I am running gurobi 10.0.3 with the server license install on hpc. I try to use the same environment and just read the gurobi file the program is trying to read and it works. I am not sure what is the problem.


0
-
Hi Junyang Cai,
The Path.glob function is returning a generator expression of PosixPath objects, and then you are passing one of these to gurobipy.read, which causes an error because this function only accepts strings.
The easiest fix is to modify the line with the read function to:
model = grb.read(str(mip_file))
so that the PosixPath is converted to a string representation.
- Riley
0
サインインしてコメントを残してください。
コメント
1件のコメント