Closed Logi-Ca1 closed 1 month ago
It's probably caused by version mismatch. Try installing the latest nightly build by pip install --pre -U torch torchvision torch_tensorrt --index-url https://download.pytorch.org/whl/nightly/cu124 --extra-index-url https://pypi.nvidia.com
Thank you, after running the pip command you provided, I am able to import torch_tensorrt without any issues now. However, I get the following error now:
Script Error
Python exception: 'NoneType' object has no attribute 'isatty'
Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 3374, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 3375, in vapoursynth._vpy_evaluate
File "P:\Test\Work.vpy", line 28, in
Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
I have a feeling that your Python environment is broken, as there is no reason for sys.stdout
to be None
.
I had the same issue with sys.stdout
being None
, and worked around it by setting it to os.devnull
instead.
To do that, put this at the top of your vapoursynth script:
import sys
import os
if sys.stdout is None:
sys.stdout = open(os.devnull, 'w') # Redirect to /dev/null (no output)
Hi HolyWu,
Thanks for your hard work, but after many hours troubleshooting I have no choice but to ask for help. I hope that's ok.
My script throws an error, and after troubleshooting, I narrowed it down to torch_tensorrt. This is what happens when I try to import torch_tensorrt in Python:
Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
I know the folder says Python34, but I assure you I have Python 3.12 installed.
Here is my pip list:
tensorrt 10.0.1 tensorrt-cu12 10.2.0.post1 tensorrt-cu12_bindings 10.0.1 tensorrt-cu12_libs 10.0.1 TIVTC 2 torch 2.5.0.dev20240802+cu124 torch_tensorrt 2.5.0.dev20240722+cu124 torchaudio 2.4.0.dev20240802+cu124 torchvision 0.20.0.dev20240802+cu124 tqdm 4.66.1 TTempSmooth 4.1 typing_extensions 4.8.0 tzlocal 1.5.1 urllib3 2.2.2 VapourSynth 69 virtualenv 16.6.1 virtualenv-clone 0.5.3 vsbasicvsr 1.0.0 vsgan 1.2.1 vsrealesrgan 1.0.0 vsrife 5.2.0 Waifu2x_NCNN_Vulkan 5 Waifu2x_NCNN_Vulkan_models 0.1 whichcraft 0.6.0 yapf 0.31.0 ZNEDI3 2.1
Am I doing something wrong?