ChenyangLEI / All-In-One-Deflicker

[CVPR2023] Blind Video Deflickering by Neural Filtering with a Flawed Atlas
686 stars 41 forks source link

How can i fix the error #18

Open panda66666666 opened 1 year ago

panda66666666 commented 1 year ago

frame= 80 fps=0.0 q=-0.0 Lsize=N/A time=00:00:08.00 bitrate=N/A speed=42.5x
video:15063kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Traceback (most recent call last): File "/root/All-In-One-Deflicker/src/stage1_neural_atlas.py", line 274, in cmd = "python src/preprocess_optical_flow.py --vid-path %s --gpu %s " % (vid_path, select_gpu) NameError: name 'select_gpu' is not defined Namespace(ckpt_filter='./pretrained_weights/neural_filter.pth', ckpt_local='./pretrained_weights/local_refinement_net.pth', fps=10, video_name='Winter_Scenes_in_Holland', gpu=0) Load ./pretrained_weights/local_refinement_net.pth Traceback (most recent call last): File "/root/All-In-One-Deflicker/src/neural_filter_and_refinement.py", line 73, in assert len(style_names) == len(content_names), "the number of style frames is different from the number of content frames" AssertionError: the number of style frames is different from the number of content frames

jamesmgg commented 1 year ago

I'm having the same error

if you uncomment these lines: https://github.com/ChenyangLEI/All-In-One-Deflicker/commit/0ce6aaf7c104744fb24b2217f14df522b155d71a

it gets past the select_gpu not being defined... but now I'm running into the next error about libcudnn_cnn_infer.so not being in the path:

Could not load library libcudnn_cnn_infer.so.8. Error: libcuda.so: cannot open shared object file: No such file or directory
Please make sure libcudnn_cnn_infer.so.8 is in your library path!
Aborted
Traceback (most recent call last):
  File "/home/pinguino/All-In-One-Deflicker/src/stage1_neural_atlas.py", line 279, in <module>
    main(json.load(f), args)
  File "/home/pinguino/All-In-One-Deflicker/src/stage1_neural_atlas.py", line 108, in main
    optical_flows_mask, video_frames, optical_flows_reverse_mask, mask_frames, video_frames_dx, video_frames_dy, optical_flows_reverse, optical_flows = load_input_data_single(
  File "/home/pinguino/All-In-One-Deflicker/src/models/stage_1/unwrap_utils.py", line 145, in load_input_data_single
    flow12 = np.load(flow12_fn)
  File "/home/pinguino/anaconda3/envs/deflicker/lib/python3.10/site-packages/numpy/lib/npyio.py", line 405, in load
    fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: 'data/test/male_dancer_720__flow_flow/00000.png_00001.png.npy'
Namespace(ckpt_filter='./pretrained_weights/neural_filter.pth', ckpt_local='./pretrained_weights/local_refinement_net.pth', fps=10, video_name='male_dancer_720__flow', gpu=0)
Load ./pretrained_weights/local_refinement_net.pth
Traceback (most recent call last):
  File "/home/pinguino/All-In-One-Deflicker/src/neural_filter_and_refinement.py", line 73, in <module>
    assert len(style_names) == len(content_names), "the number of style frames is different from the number of content frames"
AssertionError: the number of style frames is different from the number of content frames
markrmiller commented 1 year ago

Here is what I do, change deflicker to your env name:

export CUDA_VISIBLE_DEVICES=0 export LIBRARY_PATH=/opt/conda/envs/deflicker/include export LD_LIBRARY_PATH=/opt/conda/envs/deflicker/lib export CUDA_HOME=/opt/conda/envs/deflicker

As I want pytorch 2, I also uninstall pytorch with conda uninstall pytorch and then pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit conda install -c nvidia cudnn

Then run.

markrmiller commented 1 year ago

Oh, right, and as for the assert, I just comment it out.

gvonkreisler commented 4 months ago

Simply disable the if statement will do the trick