j96w / DenseFusion

"DenseFusion: 6D Object Pose Estimation by Iterative Dense Fusion" code repository
https://sites.google.com/view/densefusion
MIT License
1.08k stars 301 forks source link

FileNotFoundError When Running eval_linemod.sh on Google Colab #227

Closed zpyzpyzpyzpy closed 3 months ago

zpyzpyzpyzpy commented 3 months ago

I am trying to run the eval_linemod.sh script to evaluate the LineMOD dataset using Google Colab. However, I encounter a FileNotFoundError even though the specified file exists in the directory. Below is the error message I receive:

+ set -e
+ export PYTHONUNBUFFERED=True
+ PYTHONUNBUFFERED=True
+ export CUDA_VISIBLE_DEVICES=0
+ CUDA_VISIBLE_DEVICES=0
+ python3 /content/drive/MyDrive/DenseFusionmaster/tools/eval_linemod.py --dataset_root /content/drive/MyDrive/DenseFusionmaster/datasets/linemod/Linemod_preprocessed --model trained_checkpoints/linemod/pose_model_9_0.01310166542980859.pth --refine_model trained_checkpoints/linemod/pose_refine_model_493_0.006761023565178073.pth
System path: ['/content/drive/MyDrive/DenseFusionmaster/tools', '/env/python', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/dist-packages', '/usr/lib/python3/dist-packages', '/content/drive/MyDrive/DenseFusionmaster/datasets/linemod', '/content/drive/MyDrive/DenseFusionmaster/lib', '/content/drive/MyDrive/DenseFusionmaster']
/content/drive/MyDrive/DenseFusionmaster/lib/transformations.py:1912: UserWarning: failed to import module _transformations
  warnings.warn('failed to import module %s' % name)
Traceback (most recent call last):
  File "/content/drive/MyDrive/DenseFusionmaster/tools/eval_linemod.py", line 53, in <module>
    estimator.load_state_dict(torch.load(opt.model))
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 998, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 445, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 426, in __init__
    super().__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'trained_checkpoints/linemod/pose_model_9_0.01310166542980859.pth'

Has anyone successfully run this model on Colab? Any advice on resolving this FileNotFoundError would be greatly appreciated. Thank you!