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
288 stars 30 forks source link

Download Error #27

Closed lightyfr closed 1 year ago

lightyfr commented 1 year ago

Hey so I first downloaded docker desktop, ran docker pull styler00dollar/vsgan_tensorrt:latest, then ran DOCKER_BUILDKIT=1 docker build -t styler00dollar/vsgan_tensorrt:latest ., but it gave me an error even though I ran the anti-error one too. Even though it failed when i tried to run a video through the upscaler it gave me another error. Honestly im so confused and dont have a clue what im doing so some more simplified instructions would be so helpful if you have the time. I know there probably isn't any issues with your code its just im not skilled enough to understand what is going on. Thanks for your time.

styler00dollar commented 1 year ago

This is not the command I wrote. I wrote docker pull styler00dollar/vsgan_tensorrt:latest. Techincally this isn't even needed and all you need to do is written in this part of the readme:

# run the docker with docker-compose
# afterwards the vsgan folder will be mounted under `/workspace/tensorrt` and you can navigate 
docker-compose run --rm vsgan_tensorrt

If that fails for whatever reason, download with workaround like readme says:

# if you have `unauthorized: authentication required` problems, download the docker with 
git clone https://github.com/NotGlop/docker-drag
cd docker-drag
python docker_pull.py styler00dollar/vsgan_tensorrt:latest
docker load -i styler00dollar_vsgan_tensorrt.tar

You do not need to build the docker. Download my prebuild one with the instructions I am giving.

lightyfr commented 1 year ago

Just to clarify, I should download docker desktop from [https://docs.docker.com/desktop/install/windows-install/] and then cd into VSGAN-tensorrt-docker then run docker pull styler00dollar/vsgan_tensorrt:latest then run docker-compose run --rm vsgan_tensorrt, then go into inference.py and change the path to the one of my video im trying to upscale then open inference_config.py and unhash the model i want to use then run vspipe -c y4m inference.py - | ffmpeg -i pipe: example.mkv with the file example.mkv being the name of the video being upscaled?

styler00dollar commented 1 year ago

Close. In the ffmpeg command you specify output filename. The other stuff sounds correct. In inference_config.py you may need to adjust model paths and config values depending on what you want. For example custom engine inference with mlrt. That is the preferred way for upscaling, you can see it in readme. Some stuff is just uncommenting.

lightyfr commented 1 year ago

What is the issue here:? ```

root@8f328c63218e:/workspace/tensorrt# vspipe -c y4m inference.py - | ffmpeg -i pipe: exasde.mp4
ffmpeg version N-109993-g205117d87f Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.1 (GCC) 20230201
  configuration: --pkg-config-flags=--static --extra-cflags='-fopenmp -lcrypto -lz -ldl -static-libgcc' --extra-ldflags='-fopenmp -lcrypto -lz -ldl -static-libgcc' --extra-libs='-lstdc++ -lcrypto -lz -ldl -static-libgcc' --toolchain=hardened --disable-debug --disable-shared --disable-ffplay --enable-static --enable-gpl --enable-gray --enable-nonfree --enable-openssl --enable-iconv --enable-libxml2 --enable-libmp3lame --enable-libfdk-aac --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvpx --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libaom --enable-libvidstab --enable-libkvazaar --enable-libfreetype --enable-fontconfig --enable-libfribidi --enable-libass --enable-libsoxr --enable-libopenjpeg --enable-libdav1d --enable-librav1e --enable-libsrt --enable-libsvtav1 --enable-libdavs2 --enable-libxavs2 --enable-libvmaf --enable-cuda-nvcc --extra-cflags=-I/opt/cuda/include --extra-ldflags=-L/opt/cuda/lib64 --enable-vapoursynth --enable-libopenh264 --enable-optimizations --enable-cuda-llvm --enable-nvdec --enable-nvenc --enable-cuvid --enable-cuda --enable-pthreads --enable-runtime-cpudetect --enable-lto
  libavutil      58.  3.100 / 58.  3.100
  libavcodec     60.  6.101 / 60.  6.101
  libavformat    60.  4.100 / 60.  4.100
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  4.100 /  9.  4.100
  libswscale      7.  2.100 /  7.  2.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
Script evaluation failed:
Python exception: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape (inference.py, line 6)

Traceback (most recent call last):
  File "src/cython/vapoursynth.pyx", line 3101, in vapoursynth._vpy_evaluate
  File "inference.py", line 6
    video_path = "C:\Users\Adhitya\Downloads\avzorodub_4.mp4"
                                                             ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

pipe:: Invalid data found when processing input
root@8f328c63218e:/workspace/tensorrt# 
styler00dollar commented 1 year ago

Docker is a closed off environment. You do work with docker linux paths, and not with windows paths. Docker can not access your Windows filesystem. For that reason, the vsgan folder gets mounted. You can navigate with cd and list files with ls. By default files that are in the vsgan folder are accessible. Create different issues for different problems though.

lightyfr commented 1 year ago

I put the video in the VSGAN folder and re ran it, this is what I got:


root@8f328c63218e:/workspace/tensorrt# ffmpeg -f vapoursynth -i inference.py example.mkv -y
ffmpeg version N-109993-g205117d87f Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.1 (GCC) 20230201
  configuration: --pkg-config-flags=--static --extra-cflags='-fopenmp -lcrypto -lz -ldl -static-libgcc' --extra-ldflags='-fopenmp -lcrypto -lz -ldl -static-libgcc' --extra-libs='-lstdc++ -lcrypto -lz -ldl -static-libgcc' --toolchain=hardened --disable-debug --disable-shared --disable-ffplay --enable-static --enable-gpl --enable-gray --enable-nonfree --enable-openssl --enable-iconv --enable-libxml2 --enable-libmp3lame --enable-libfdk-aac --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvpx --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libaom --enable-libvidstab --enable-libkvazaar --enable-libfreetype --enable-fontconfig --enable-libfribidi --enable-libass --enable-libsoxr --enable-libopenjpeg --enable-libdav1d --enable-librav1e --enable-libsrt --enable-libsvtav1 --enable-libdavs2 --enable-libxavs2 --enable-libvmaf --enable-cuda-nvcc --extra-cflags=-I/opt/cuda/include --extra-ldflags=-L/opt/cuda/lib64 --enable-vapoursynth --enable-libopenh264 --enable-optimizations --enable-cuda-llvm --enable-nvdec --enable-nvenc --enable-cuvid --enable-cuda --enable-pthreads --enable-runtime-cpudetect --enable-lto
  libavutil      58.  3.100 / 58.  3.100
  libavcodec     60.  6.101 / 60.  6.101
  libavformat    60.  4.100 / 60.  4.100
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  4.100 /  9.  4.100
  libswscale      7.  2.100 /  7.  2.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
[vapoursynth @ 0x55dd898f48c0] Failed to parse script: Python exception: operator(): open engine failed

Traceback (most recent call last):
  File "src/cython/vapoursynth.pyx", line 3115, in vapoursynth._vpy_evaluate
  File "src/cython/vapoursynth.pyx", line 3116, in vapoursynth._vpy_evaluate
  File "inference.py", line 7, in <module>
    clip = inference_clip(video_path)
  File "/workspace/tensorrt/inference_config.py", line 163, in inference_clip
    clip = core.trt.Model(
  File "src/cython/vapoursynth.pyx", line 2847, in vapoursynth.Function.__call__
vapoursynth.Error: operator(): open engine failed

inference.py: Generic error in an external library
lightyfr commented 1 year ago

I ran it again and got this: root@5cc7395ace83:/workspace/tensorrt# ffmpeg -f vapoursynth -i inference.py example.mp4 -y ffmpeg version N-109993-g205117d87f Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.1 (GCC) 20230201 configuration: --pkg-config-flags=--static --extra-cflags='-fopenmp -lcrypto -lz -ldl -static-libgcc' --extra-ldflags='-fopenmp -lcrypto -lz -ldl -static-libgcc' --extra-libs='-lstdc++ -lcrypto -lz -ldl -static-libgcc' --toolchain=hardened --disable-debug --disable-shared --disable-ffplay --enable-static --enable-gpl --enable-gray --enable-nonfree --enable-openssl --enable-iconv --enable-libxml2 --enable-libmp3lame --enable-libfdk-aac --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvpx --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libaom --enable-libvidstab --enable-libkvazaar --enable-libfreetype --enable-fontconfig --enable-libfribidi --enable-libass --enable-libsoxr --enable-libopenjpeg --enable-libdav1d --enable-librav1e --enable-libsrt --enable-libsvtav1 --enable-libdavs2 --enable-libxavs2 --enable-libvmaf --enable-cuda-nvcc --extra-cflags=-I/opt/cuda/include --extra-ldflags=-L/opt/cuda/lib64 --enable-vapoursynth --enable-libopenh264 --enable-optimizations --enable-cuda-llvm --enable-nvdec --enable-nvenc --enable-cuvid --enable-cuda --enable-pthreads --enable-runtime-cpudetect --enable-lto libavutil 58. 3.100 / 58. 3.100 libavcodec 60. 6.101 / 60. 6.101 libavformat 60. 4.100 / 60. 4.100 libavdevice 60. 2.100 / 60. 2.100 libavfilter 9. 4.100 / 9. 4.100 libswscale 7. 2.100 / 7. 2.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 inference.py: No such file or directory

styler00dollar commented 1 year ago

Well the error tells you what you did wrong. vapoursynth.Error: operator(): open engine failed. Engine does not exist with given path. Fix your config. Closing issue since download error seems to be resolved.