You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that torchvision needs to be included in the requirements list. I tried to create a conda environment with just pytorch and python3.7, but that didn't work.
Traceback (most recent call last):
File "DISTS_pt.py", line 8, in <module>
from torchvision import models, transforms
ModuleNotFoundError: No module named 'torchvision'
Adding the torchvision to the requirements list fix this.
Additionally, when using the conda env, the path to the weights file DISTS_pytorch/weights.pt seems to point to an incorrect path. The sys.prefix points to the env directory (example: /home/karinabogdan/anaconda3/envs/dists/) and not the weights file in DISTS_pytorch/
python DISTS_pt.py --ref ../example_input/12_enh.jpg --dist ../example_input/12_raw.jpg
Traceback (most recent call last):
File "DISTS_pt.py", line 134, in <module>
model = DISTS().to(device)
File "DISTS_pt.py", line 63, in __init__
weights = torch.load(os.path.join(sys.prefix, 'weights.pt'))
File "/home/karinabogdan/anaconda3/envs/dists/lib/python3.7/site-packages/torch/serialization.py", line 581, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/karinabogdan/anaconda3/envs/dists/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/karinabogdan/anaconda3/envs/dists/lib/python3.7/site-packages/torch/serialization.py", line 211, in __init__
super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/home/karinabogdan/anaconda3/envs/dists/weights.pt'
It seems that
torchvision
needs to be included in the requirements list. I tried to create a conda environment with just pytorch and python3.7, but that didn't work.Conda environment created with:
Error:
Adding the torchvision to the requirements list fix this.
Additionally, when using the conda env, the path to the weights file
DISTS_pytorch/weights.pt
seems to point to an incorrect path. Thesys.prefix
points to the env directory (example:/home/karinabogdan/anaconda3/envs/dists/
) and not the weights file inDISTS_pytorch/
I fixed that by changing the line:
to
but I am not sure if this is the best way to handle this.
The text was updated successfully, but these errors were encountered: