k4yt3x / video2x

A machine learning-based lossless video super resolution framework. Est. Hack the Valley II, 2018.
https://video2x.org
GNU Affero General Public License v3.0
10.68k stars 1k forks source link

invalid literal for int() with base 10: '' #463

Closed timsu92 closed 3 years ago

timsu92 commented 3 years ago

Component Versions

Please at least fill in the release version and GUI or CLI version.

Symptom

The symptom is just as same as the title.😉 So... I think it would be better to type what I've done.

  1. Select a mpg file
  2. Change settings:
    1. Main
      1. driver: Waifu2X Caffe
      2. processes: 8 (btw, should I type it the cores of CPU?)
      3. Scale Ratio: 2.8
    2. Driver Settings - Waifu2X Caffe
      1. process: cudnn
      2. GPU: 1 ( got this info from Windows Task Manager )

System vars:

Error Log or Screenshots

Output from "save" button in GUI

[+] INFO: Loading files into processing queue 2021-02-19 20:03:01.681900 [+] INFO: Input path(s): D:\外接碟備份\攝影機\素材\1.mpg 2021-02-19 20:03:01.682897 [+] INFO: File MIME type: video/mpeg [+] INFO: Loaded files into processing queue 2021-02-19 20:03:01.690872 [+] INFO: Input file: D:\外接碟備份\攝影機\素材\1.mpg [+] INFO: Reading file information 2021-02-19 20:03:01.691899 [+] INFO: Executing: D:\Documents\temp\video2x-4.8.1-win32-full\dependencies\ffmpeg\bin\ffprobe -v quiet -print_format json -show_format -show_streams -i D:\外接碟備份\攝影機\素材\1.mpg 2021-02-19 20:03:03.668566 [+] INFO: Creating cache directory C:\Users\TimSu\AppData\Local\Temp\video2x 2021-02-19 20:03:03.669563 [+] INFO: Extracted frames are being saved to: C:\Users\TimSu\AppData\Local\Temp\video2x\tmp50uts2li 2021-02-19 20:03:03.670560 [+] INFO: Upscaled frames are being saved to: C:\Users\TimSu\AppData\Local\Temp\video2x\tmpovq71jv1 [+] INFO: Starting upscaling video/GIF [+] INFO: Getting total number of frames in the file 2021-02-19 20:03:03.671559 [+] INFO: Executing: D:\Documents\temp\video2x-4.8.1-win32-full\dependencies\ffmpeg\bin\ffprobe -v quiet -count_frames -select_streams v:1 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 D:\外接碟備份\攝影機\素材\1.mpg Cleaning up cache directory: C:\Users\TimSu\AppData\Local\Temp\video2x\tmp50uts2li Cleaning up cache directory: C:\Users\TimSu\AppData\Local\Temp\video2x\tmpovq71jv1 Cleaning up cache directory: C:\Users\TimSu\AppData\Local\Temp\video2x Traceback (most recent call last): File "video2x_gui.py", line 105, in run File "upscaler.py", line 1022, in run File "upscaler.py", line 716, in run File "wrappers\ffmpeg.py", line 112, in get_number_of_frames ValueError: invalid literal for int() with base 10: ''

All the "�" shows image in Notepad++

Output in the cmd window

image

timsu92 commented 3 years ago

Although there are 4 more issues with the same title, it seems that everyone got different problems... I'm not sure whether I should try this comment ? It looks alike...?

k4yt3x commented 3 years ago

This issue might be fixed with the latest nightly build. The link's in the main README page.

timsu92 commented 3 years ago

OK, I used the one pushed 22days ago, and both of tries failed. In both of these tries, due to lack enough storage in C:\, I changed cache folder to another folder in f:\ After downloading, I ran video2x_setup.exe -d waifu2x_caffe and video2x_setup.exe -d ffmpeg

First try: processes=8

video2x_nightly_error.log After half and an hour, it seems that I was out of memory (in line 4257)

I guess... too many processes caused it, so I changed to 3.

Second try: processes=3

video2x_nightly_error2.log This is kinda strange. In line 533 it says OpenCV got an error in a file in e:\. However, I don't have this volume! On the other hand, there's invalid device ordinal in line 523. Does that mean the GPU no selecting is incorrect? However, if I change it from 1 to 0, it stucks like this and drains CPU and GPU, and I don't know what happened. image

k4yt3x commented 3 years ago

Now you're getting a different type of failure. Don't use more than one process. Multi-processing doesn't help machine-learning stuff that much. Also, a single thread would take up a lot of VRAM. If you have spare VRAM left when running a single process, try increasing the crop size.

This is kinda strange. In line 533 it says OpenCV got an error in a file in e:. However, I don't have this volume!

This is debugging information added during compilation. Ignore it.

timsu92 commented 3 years ago

OK, now I'm stuck in cudaSuccess (101 vs. 0) invalid device ordinal This happens when I select GPU 1. But I think it's correct, and choosing 0 (intel), or anything above 1 (I have 2 cards only) will be exit status 1, which is said in Q&A. (ps. The results of choosing GPU 0 are different between yesterday's and today's. Yesterday, it kept running without any disk usage. Today, it found GPU 0 isn't a Nvidia one) Moreover, when I choose GPU 1, exit status isn't 1, it's 3221226505.

The output from nvidia-smi.exe looks like this when nothing is running: image

k4yt3x commented 3 years ago

I'll still need the error logs though.

timsu92 commented 3 years ago

Oops! I lost them! Therefore, I'm doing it again, but the symptoms are different now!

GPU=0 ( Intel )

Yesterday, probably after a 40-minute run-time, Windows crashed, so I'm afraid I can't provide a log😥 The stop code on blue screen was DRIVER_IRQL_NOT_LESS_OR_EQUAL and the failure item was nvlddmkm.sys

I'm trying it again today, and it has been working for 3 hours with 14 frames, while the video has 16807... I'll keep watching it👓

GPU=1 ( Nvidia )

gpu1.log in line 456: invalid device ordinal in line 479: ERROR: Subprocess 13024 exited with code 3221226505 in line 497: returned non-zero exit status 3221226505

GPU=2 ( there should be no this GPU exist)

gpu2.log in line 1241: invalid device ordinal in line 1258: Subprocess 14516 exited with code 3221226505 in line 1276: returned non-zero exit status 3221226505

k4yt3x commented 3 years ago

DRIVER_IRQL_NOT_LESS_OR_EQUAL

This wouldn't be a problem I can solve.... It's a problem in the upstream somewhere, either with Windows, your drivers, or with waifu2x-caffe.

invalid device ordinal

According to an issue created in Caffe's official repository (https://github.com/BVLC/caffe/issues/4894), this is an upstream hardware/sys issue. I'm afraid there's nothing I can do to fix this problem at the moment.

Sorry, this is a hardware/system configuration issue with CUDA. The problem is not related to Caffe itself.

However, here are some things you can try:

timsu92 commented 3 years ago

Install cuDNN and use waifu2x-caffe's...

I'm using cudnn right now, but the speed is mentioned like above... Meanwhile, Cuda isn't full running on GPU 1 when GPU set to 0. It goes like a second 100% and a second 0% along with the Copy engine. May I have the some info about upscale you did? Like the hardware environment, time it ran, and length of the video? I'm not sure if this speed is caused by the poor performance of my GPU...

Update your system and your drivers...

They are up-to-date. But this driver version is designed for Windows Insider Preview (and/or use it in WSL at the same time) Maybe it worth a try to downgrade to a normal one...

timsu92 commented 3 years ago

The reason why I mentioned GPU 2 is that there's no this one, but the exit code was 3221226505 instead of 1. But it looks like the problem is of waifu2x-caffe and it's hard to do something with it right?

k4yt3x commented 3 years ago

...the exit code was 3221226505 instead of 1.

I only know non-zero return value is an error. There are some predefined return numbers in Linux, but waifu2x-caffe's return values seems to be generated from some internal logic meaningless to me. I'm not sure why you're saying "instead of 1." Is it supposed to be something else?

I'm using cudnn right now, but the speed is mentioned like above...

The upscaling looks to be running correctly in your -2 screenshot. It's using GPU and it seems to be running without problems. What FPS are you getting?

timsu92 commented 3 years ago

I only know non-zero return value...

Ya, this's a thing programmers usually do. In Q&A, code 1 means a non-nvidia GPU is selected. Although p means q doesn't always means q means p, I guess finding the GPU used isn't a nvidia one is easy. In another comment above which I forgot to attach logs, my guess was true. However, it changed in the next day...

Please teach me if I'm wrong.

The upscaling looks to be running correctly...

After tries in these days, I found Waifu2x-caffe is really slow. The FPS was 0.00... Now I'm using RealSR ncnn Vulkan. It's faster, however, FPS is still just 0.04. It looks like 24hr+37min has passed and 3354 frames were processed.

k4yt3x commented 3 years ago

In Q&A, code 1 means a non-nvidia GPU is selected.

That number could be any other number really. I didn't see an official explanation on waifu2x-caffe's documentations, so it could be any number. Getting a random integer like you did doesn't mean the GPU is detected to be an NVIDIA GPU.

Now I'm using RealSR ncnn Vulkan. It's faster, however, FPS is still just 0.04.

RealSR is typically way way way slower than waifu2x-caffe. If your waifu2x-caffe works, it should be quite a bit faster than RealSR. With that said, if you're upscaling real-life videos, RealSR will give you better results anyways.

timsu92 commented 3 years ago

Hmm... things often get strange in computer world...

Now, I'm using RealSR ncnn Vulkan, and here are some info about it. No any more problem at present.

If I use **GPU 0 ( Intel )**, it's nearly taking a rest it self However, GPU 1 ( Nvidia ) is quite busy. But the way it gets busy is the Compute_1 engine, not Cuda. Also, the usage is 0%. ![image](https://user-images.githubusercontent.com/33785401/108828806-45eb6900-7602-11eb-9776-27ad16e7be7f.png) And if I use **GPU 1 ( Nvidia )**, things reverses. 3D in GPU 0 will work hard and GPU 1 will totally take a rest😂
TT-Hipster1941 commented 1 year ago

I don't consider using only one GPU is a solution :/