styler00dollar / VSGAN-tensorrt-docker

Using VapourSynth with super resolution and interpolation models and speeding them up with TensorRT.
BSD 3-Clause "New" or "Revised" License
286 stars 30 forks source link

Invalid data found when processing input #13

Closed NeoBurgerYT closed 2 years ago

NeoBurgerYT commented 2 years ago

Hey when i start the inference.py script this happen :

someone can help me ?


> ffmpeg version N-62110-g4d45f5acbd-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2022 the FFmpeg developers
>   built with gcc 8 (Debian 8.3.0-6)
>   configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
>   libavutil      57. 26.100 / 57. 26.100
>   libavcodec     59. 33.100 / 59. 33.100
>   libavformat    59. 24.100 / 59. 24.100
>   libavdevice    59.  6.100 / 59.  6.100
>   libavfilter     8. 40.100 /  8. 40.100
>   libswscale      6.  6.100 /  6.  6.100
>   libswresample   4.  6.100 /  4.  6.100
>   libpostproc    56.  5.100 / 56.  5.100
> Information: Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt
> Information: Generating grammar tables from /usr/lib/python3.8/lib2to3/PatternGrammar.txt
> Script evaluation failed:
> Python exception: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory
> 
> Traceback (most recent call last):
>   File "src\cython\vapoursynth.pyx", line 2890, in vapoursynth._vpy_evaluate
>   File "src\cython\vapoursynth.pyx", line 2891, in vapoursynth._vpy_evaluate
>   File "inference.py", line 85, in <module>
>     clip = ESRGAN_inference(clip=clip, model_path="/workspace/RealESRGAN_x4plus_anime_6B.pth", tile_x=480, tile_y=480, tile_pad=16, fp16=False, tta=False, tta_mode=1)
>   File "/workspace/tensorrt/src/esrgan.py", line 680, in ESRGAN_inference
>     import torch_tensorrt
>   File "/usr/local/lib/python3.8/dist-packages/torch_tensorrt/__init__.py", line 11, in <module>
>     from torch_tensorrt._compile import *
>   File "/usr/local/lib/python3.8/dist-packages/torch_tensorrt/_compile.py", line 2, in <module>
>     from torch_tensorrt import _enums
>   File "/usr/local/lib/python3.8/dist-packages/torch_tensorrt/_enums.py", line 1, in <module>
>     from torch_tensorrt._C import dtype, DeviceType, EngineCapability, TensorFormat
> ImportError: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory
> 
> pipe:: Invalid data found when processing input
styler00dollar commented 2 years ago

Hmm... maybe I broke something while using self-compiled torch, will look later.

NeoBurgerYT commented 2 years ago

Hmm... maybe I broke something while using self-compiled torch, will look later.

ok no problem, can you tell me when its good ?

styler00dollar commented 2 years ago

Sure. Can reproduce, seems like I am right and my PyTorch compile makes trouble.

NeoBurgerYT commented 2 years ago

Sure. Can reproduce, seems like I am right and my PyTorch compile makes trouble.

oh i see ok, i will wait so good luck !

styler00dollar commented 2 years ago

Seems like in my custom PyTorch I dont have certain .so files, after copying the ones I had I had undefined symbols. I rebuild docker with nightly PyTorch 1.13 and it fails with undefined symbol. For now the fastest fix is to downgrade PyTorch 1.11, because Torch-Tensorrt does not support latest PyTorch.

pip install torch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113

I don't really want to downgrade PyTorch for now, well recompiling will take more time. For now you can just manually downgrade PyTorch after starting docker.

NeoBurgerYT commented 2 years ago

ok I will try that tomorrow and I give you more info !

styler00dollar commented 2 years ago

Hmm, after some more thinking, I think it would be better to downgrade PyTorch so people don't have problems and I will update once I have it working with the new version. Updated dockerhub and Dockerfile. Currently uploading to dockerhub, the image will soon be there. You could test to verify, then I would close this issue.

Edit: Dockerhub updated.

NeoBurgerYT commented 2 years ago

Ok so, I try with the downgrade PyTorch but it still not working for me, i don't know if I'm doing something wrong... :c

Did I have to resinstall everything ?

For now I have this message:

> Script evaluation failed:
> Python exception: /usr/local/lib/python3.8/dist-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN3c106detail14torchCheckFailEPKcS2_jRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
> 
> Traceback (most recent call last):
>   File "src\cython\vapoursynth.pyx", line 2890, in vapoursynth._vpy_evaluate
>   File "src\cython\vapoursynth.pyx", line 2891, in vapoursynth._vpy_evaluate
>   File "inference.py", line 17, in <module>
>     from vsbasicvsrpp import BasicVSRPP
>   File "/usr/local/lib/python3.8/dist-packages/vsbasicvsrpp/__init__.py", line 10, in <module>
>     from .basicvsr_pp import BasicVSRPlusPlus
>   File "/usr/local/lib/python3.8/dist-packages/vsbasicvsrpp/basicvsr_pp.py", line 8, in <module>
>     from mmcv.ops import ModulatedDeformConv2d, modulated_deform_conv2d
>   File "/usr/local/lib/python3.8/dist-packages/mmcv/ops/__init__.py", line 2, in <module>
>     from .active_rotated_filter import active_rotated_filter
>   File "/usr/local/lib/python3.8/dist-packages/mmcv/ops/active_rotated_filter.py", line 10, in <module>
>     ext_module = ext_loader.load_ext(
>   File "/usr/local/lib/python3.8/dist-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
>     ext = importlib.import_module('mmcv.' + name)
>   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
> ImportError: /usr/local/lib/python3.8/dist-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN3c106detail14torchCheckFailEPKcS2_jRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
> 
> pipe:: Invalid data found when processing input
styler00dollar commented 2 years ago

Guess I overlooked mmcv, so downgrading with pip like I said could make issues, sigh.

Try redownloading the docker from dockerhub or build the docker from scratch. I updated stuff there. I hope it now works.

Well I am sorry for the inconvenience, I don't have much time to test every functionality during the week and just applied some quick fixes. Maybe I will test this weekend.

styler00dollar commented 2 years ago

I quickly tested functionality with the updates, seems like it works. Closing issue. Delete your current docker image and do either docker pull styler00dollar/vsgan_tensorrt:latest or docker build --no-cache -t styler00dollar/vsgan_tensorrt:latest .. You can message here if you encounter further problems.