ProGamerGov / neural-style-pt

PyTorch implementation of neural style transfer algorithm
MIT License
833 stars 178 forks source link

Error Message caffe2_nvrtc.dll #77

Open jr751 opened 3 years ago

jr751 commented 3 years ago

I keep getting an error message related to this caffe2_nvrtc.dll when I run the command:

neural-style -style_image C:\\Users\\crovn\\Desktop\\Brooklyn_Bridge_Manhattan.jpg -content_image C:\\Users\\crovn\\Desktop\\MonaLisaOriginal.jpg -output_image C:\\Users\\crovn\\Desktop\\profile.png

The error message that I get reads:

Traceback (most recent call last): File "c:\users\crovn\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\crovn\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\crovn\AppData\Roaming\Python\Python38\Scripts\neural-style.exe\__main__.py", line 4, in <module> File "C:\Users\crovn\AppData\Roaming\Python\Python38\site-packages\neural_style\neural_style.py", line 5, in <module> import torch File "c:\users\crovn\appdata\local\programs\python\python38\lib\site-packages\torch\__init__.py", line 81, in <module> ctypes.CDLL(dll) File "c:\users\crovn\appdata\local\programs\python\python38\lib\ctypes\__init__.py", line 373, in __init__ self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'c:\users\crovn\appdata\local\programs\python\python38\lib\site-packages\torch\lib\caffe2_nvrtc.dll' (or one of its dependencies). Try using the full path with constructor syntax.

When I go to the file path, c:\users\crovn\appdata\local\programs\python\python38\lib\site-packages\torch\lib\, in Windows 10's file explorer it shows that the file caffe2_nvrtc.dll is in fact present so I don't understand why this isn't working. I am using Python 3.8 using the Thonny IDE on Windows 10. To install pytorch I used the command pip3.8 install torch===1.5.1 torchvision===0.6.1 -f https://download.pytorch.org/whl/torch_stable.html.

How do I fix this problem?

sawtl commented 3 years ago

For Windows, try Anaconda and install pytorch with max cuda 10.1 (see pytorch site). It works fine.