HolyWu / vs-rife

RIFE function for VapourSynth
MIT License
94 stars 7 forks source link

error when run cmd "python -m vsrife" #24

Closed Usulyre closed 11 months ago

Usulyre commented 1 year ago

Got this error when run cmd "python -m vsrife"

C:\Windows\System32>python -m vsrife Traceback (most recent call last): File "", line 189, in _run_module_as_main File "", line 148, in _get_module_details File "", line 112, in _get_module_details File "C:\Program Files\Python311\Lib\site-packages\vsrife__init.py", line 13, in from torch_tensorrt.fx import compile File "C:\Program Files\Python311\Lib\site-packages\torch_tensorrt\fx__init__.py", line 1, in from .converters import * # noqa: F403 F401 ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\site-packages\torch_tensorrt\fx\converters\init__.py", line 2, in import tensorrt as trt ModuleNotFoundError: No module named 'tensorrt'

C:\Windows\System32>

Also, where do I put the files i downloaded from after i uncompress them:

https://github.com/HolyWu/vs-rife/releases/download/v3.1.0/CUDA-11.7_cuDNN-8.6.0_TensorRT-8.5.2.2_win64.7z

aodgizmo commented 1 year ago

https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html will tell you how to install the TensorRT.

Pretty much download the zip, extract it, set system environment PATH to the folder you just extracted or CUDA{version}/Bin if missing, move DLL files from LIB to CUDA/{Version}/Bin, and run a couple PIP installs. Goto Extracted folder/python and run python.exe -m pip install tensorrt-*-cp3x-none-win_amd64.whl

After all that you need to run a couple PIP installs, these can be found in the extracted folder of TensorRT you just downloaded from nvidia. python3 -m pip install \graphsurgeon\graphsurgeon-0.4.6-py2.py3-none-any.whl python3 -m pip install \uff\uff-0.6.9-py2.py3-none-any.whl python3 -m pip install \onnx_graphsurgeon\onnx_graphsurgeon-0.3.12-py2.py3-none-any.whl

Good luck!

Usulyre commented 1 year ago

https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html will tell you how to install the TensorRT.

Pretty much download the zip, extract it, set system environment PATH to the folder you just extracted or CUDA{version}/Bin if missing, move DLL files from LIB to CUDA/{Version}/Bin, and run a couple PIP installs. Goto Extracted folder/python and run python.exe -m pip install tensorrt-*-cp3x-none-win_amd64.whl

After all that you need to run a couple PIP installs, these can be found in the extracted folder of TensorRT you just downloaded from nvidia. python3 -m pip install \graphsurgeon\graphsurgeon-0.4.6-py2.py3-none-any.whl python3 -m pip install \uff\uff-0.6.9-py2.py3-none-any.whl python3 -m pip install \onnx_graphsurgeon\onnx_graphsurgeon-0.3.12-py2.py3-none-any.whl

Good luck!

Hi and thanks for your reply.

I got an error message when I ran that first cmdline. I have a GTX 1660.

ERROR: tensorrt-8.5.2.2-cp310-none-win_amd64.whl is not a supported wheel on this platform.

aodgizmo commented 1 year ago

Hi and thanks for your reply.

I got an error message when I ran that first cmdline. I have a GTX 1660.

ERROR: tensorrt-8.5.2.2-cp310-none-win_amd64.whl is not a supported wheel on this platform.

Make sure you are using python 3.10 if you are typing 310. Also try updating PIP to newest version and make sure you have python 64 bit version.

More info on your possible problem. https://stackoverflow.com/a/39945920

Usulyre commented 1 year ago

Hi and thanks for your reply. I got an error message when I ran that first cmdline. I have a GTX 1660. ERROR: tensorrt-8.5.2.2-cp310-none-win_amd64.whl is not a supported wheel on this platform.

Make sure you are using python 3.10 if you are typing 310. Also try updating PIP to newest version and make sure you have python 64 bit version.

More info on your possible problem. https://stackoverflow.com/a/39945920

I have python 64 bit 3.11

Does that matter?

aodgizmo commented 1 year ago

If you have 3.11, you need to type 3.11 when typing the command

tensorrt-8.5.2.2-cp310-none-win_amd64.whl should be tensorrt-8.5.2.2-cp311-none-win_amd64.whl

Usulyre commented 1 year ago

If you have 3.11, you need to type 3.11 when typing the command

tensorrt-8.5.2.2-cp310-none-win_amd64.whl should be tensorrt-8.5.2.2-cp311-none-win_amd64.whl

when i run "python -m vsrife"

\Program Files\Python310\lib\site-packages\torch_tensorrt\fx\tracer\acc_tracer\acc_ops.py:840: UserWarning: Unable to import torchvision related libraries.: No module named 'torchvision'. Please install torchvision lib in order to lower stochastic_depth

when i run the script i get "RIFE: cuda is not available"

aodgizmo commented 1 year ago

What does it say when you type nvcc --version. Should say if you have CUDA installed or not.

For Please install torchvision lib in order to lower stochastic_depth

Try pip install torchvision

Not trying to be mean, but if you can't figure out these simple problems your gonna have a bad time trying to run the more complicated tasks. Kinda seems like you don't even have CUDA install from nvidia even.

Usulyre commented 1 year ago

What does it say when you type nvcc --version. Should say if you have CUDA installed or not.

For Please install torchvision lib in order to lower stochastic_depth

Try pip install torchvision

Not trying to be mean, but if you can't figure out these simple problems your gonna have a bad time trying to run the more complicated tasks. Kinda seems like you don't even have CUDA install from nvidia even.

nvcc-version doesn't work as is?

I tried to follow this guide:

https://www.svp-team.com/forum/viewtopic.php?pid=81456#p81456

I still had the same issue with "RIFE: cuda is not available"

aodgizmo commented 1 year ago

You need to download and install Nvidia Cuda toolkit. You might need to make a account with them first.

https://developer.nvidia.com/cuda-downloads

When installed you should be able to run and see this output.

nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0

Find a guide to install CUDA and make sure to add them to your system PATH or it wont find it when you try to run them. Also if you get stuck , try asking CHAT-GPT about how to install it. Good Luck!

Usulyre commented 1 year ago

I thought everything is included for the windows release:

"For ease of installation on Windows, you can download the 7z file on Releases which contains required runtime libraries and Python wheel file"

aodgizmo commented 1 year ago

I thought everything is included for the windows release:

"For ease of installation on Windows, you can download the 7z file on Releases which contains required runtime libraries and Python wheel file"

NVIDIA CUDA is a separate thing and needs to be installed for many AI programs to work.

Usulyre commented 1 year ago

I thought everything is included for the windows release: "For ease of installation on Windows, you can download the 7z file on Releases which contains required runtime libraries and Python wheel file"

NVIDIA CUDA is a separate thing and needs to be installed for many AI programs to work.

Would cuda for python work?

pip install cuda-python

aodgizmo commented 1 year ago

Would cuda for python work?

pip install cuda-python

Not sure, I installed mine with the package from NVIDIA website.

Usulyre commented 1 year ago

Would cuda for python work? pip install cuda-python

Not sure, I installed mine with the package from NVIDIA website.

Downloaded cudatoolkit v11.7

Not sure what from the custom install selection that I need keep check for cuda to be available for vs-rife.

I just selected cuda runtime libraries and nvcc and added to the path

Still not working.

aodgizmo commented 1 year ago

When you run nvcc --version

Do you see?

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0

If it says something like command not found, it is most likely not set in the path correctly.

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

Usulyre commented 1 year ago

When you run nvcc --version

Do you see?

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0

If it says something like command not found, it is most likely not set in the path correctly.

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

I have to go to the actual folder where nvcc is to run that command

aodgizmo commented 1 year ago

Ya, that means you did not add it to the PATH correctly. When it is added to the path it tells the system where to find NVCC when you run it.

aodgizmo commented 1 year ago

https://medium.com/analytics-vidhya/tensorflow-gpu-how-to-install-tensorflow-with-nvidia-cuda-cudnn-and-gpu-support-on-windows-6158cffc1c29

step 5.3: Confirming that CUDA environment variables are set in Windows

For CUDA to function properly, you will need to ensure that CUDA environment variables are set in your PC‘s Path. To confirm, you will need to check the Environment Variables. This can be found by following these steps

Control Panel -> System and Security -> System-> Advanced System settings.

This will open up a window, click on the Advanced tab. as shown below Image by author

https://miro.medium.com/v2/resize:fit:640/format:webp/1*a9zoQnDYS4vF8rofF7levw.png

https://miro.medium.com/v2/resize:fit:640/format:webp/1*7WOGbl9LAE4hoSjV-9Wehg.png

These paths are automatically added, but in case you can’t find them. Just type in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin and C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\V11.2\libnvvp.
Usulyre commented 1 year ago

https://medium.com/analytics-vidhya/tensorflow-gpu-how-to-install-tensorflow-with-nvidia-cuda-cudnn-and-gpu-support-on-windows-6158cffc1c29

step 5.3: Confirming that CUDA environment variables are set in Windows

For CUDA to function properly, you will need to ensure that CUDA environment variables are set in your PC‘s Path. To confirm, you will need to check the Environment Variables. This can be found by following these steps

Control Panel -> System and Security -> System-> Advanced System settings.

This will open up a window, click on the Advanced tab. as shown below Image by author

https://miro.medium.com/v2/resize:fit:640/format:webp/1*a9zoQnDYS4vF8rofF7levw.png

https://miro.medium.com/v2/resize:fit:640/format:webp/1*7WOGbl9LAE4hoSjV-9Wehg.png

These paths are automatically added, but in case you can’t find them. Just type in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin and C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\V11.2\libnvvp.

I dont know what libnvvp is for which i do not currently have.

nvcc works now but still getting the error of cuda not available.

By the way, this is part of the error when one looks at init.py of vsrife

if not torch.cuda.is_available(): raise vs.Error('RIFE: CUDA is not available')

aodgizmo commented 1 year ago

Since I have 11.8 CUDA installed, mine is located at...

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp

You can try adding these to the PATH if you installed them to the same location. Also you can check them folders to see if that is where they are.

Usulyre commented 1 year ago

Since I have 11.8 CUDA installed, mine is located at...

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp

You can try adding these to the PATH if you installed them to the same location. Also you can check them folders to see if that is where they are.

By the way, this is part of the error when one looks at init.py of vsrife

if not torch.cuda.is_available(): raise vs.Error('RIFE: CUDA is not available')

aodgizmo commented 1 year ago

You need to run nvcc --version. It will tell you if its installed or not.

Usulyre commented 1 year ago

You need to run nvcc --version. It will tell you if its installed or not.

C:\Windows\System32>nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Tue_May__3_19:00:59_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.7, V11.7.64 Build cuda_11.7.r11.7/compiler.31294372_0

aodgizmo commented 1 year ago

Great, so that is installed correctly. The error you are getting I have no experience with. So looks like my help ends here. I wish you luck!