lhwcv / mlsd_pytorch

Pytorch implementation of "M-LSD: Towards Light-weight and Real-time Line Segment Detection"
Apache License 2.0
189 stars 37 forks source link

No such file or directory: '/models/mlsd_large_512_fp32.pth' #3

Closed shukkkur closed 3 years ago

shukkkur commented 3 years ago

After trying to execute !python demo.py, I get an error:

Traceback (most recent call last): File "demo.py", line 37, in main() File "demo.py", line 23, in main model.load_state_dict(torch.load(model_path, map_location=device), strict=True) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 594, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/models/mlsd_large_512_fp32.pth `

The file mlsd_large_512_fp32.pth is in the same directory as well as the models folder

shukkkur commented 3 years ago

Changed os.path.dirname(__file__) to os.getcwd() in demo.py file