CyFeng16 / MVIMP

Mixed Video and Image Manipulation Program
GNU General Public License v3.0
71 stars 20 forks source link

/content/MVIMP/Data/Input/%10d.png: No such file or directory #28

Closed Richie-Z closed 3 years ago

Richie-Z commented 4 years ago

using a test video you provided and got this error.

Current PyTorch version is 1.0.0
ffmpeg -hide_banner -loglevel warning -threads 4 -i /content/MVIMP/Data/Input/test.mp4 /content/MVIMP/Data/Input/%8d.png
The video-image extracting job is done.

--------------------SUMMARY--------------------
Current input video file is test.mp4,
test.mp4's fps is 23.98,
test.mp4 has 575 frames.
Now we will process this video to 47.96 fps.
Frame split method will be used.
--------------------NOW END--------------------

python3 -W ignore vfi_helper.py --src /content/MVIMP/Data/Input --dst /content/MVIMP/Data/Output --time_step 0.5 --high_resolution 
revise the unique id to a random numer 29614
Namespace(SAVED_MODEL='./model_weights/best.pth', alpha=[0.0, 1.0], arg='./model_weights/29614-Sun-Jun-21-17:33/args.txt', batch_size=1, channels=3, ctx_lr_coe=1.0, datasetName='Vimeo_90K_interp', datasetPath='', dataset_split=97, debug=False, depth_lr_coe=0.001, dst='/content/MVIMP/Data/Output', dtype=<class 'torch.cuda.FloatTensor'>, epsilon=1e-06, factor=0.2, filter_lr_coe=1.0, filter_size=4, flow_lr_coe=0.01, force=False, high_resolution=True, log='./model_weights/29614-Sun-Jun-21-17:33/log.txt', lr=0.002, netName='DAIN_slowmotion', no_date=False, numEpoch=100, occ_lr_coe=1.0, patience=5, rectify_lr=0.001, save_path='./model_weights/29614-Sun-Jun-21-17:33', save_which=1, seed=1, src='/content/MVIMP/Data/Input', time_step=0.5, uid=None, use_cuda=True, use_cudnn=1, weight_decay=0, workers=8)
cudnn is used
Interpolate 1 frames
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=51 error=38 : no CUDA-capable device is detected
Traceback (most recent call last):
  File "vfi_helper.py", line 179, in <module>
    training=False,
  File "/content/MVIMP/third_party/DAIN/networks/DAIN_slowmotion.py", line 51, in __init__
    self.flownets = PWCNet.__dict__["pwc_dc_net"]()
  File "/content/MVIMP/third_party/DAIN/PWCNet/PWCNet.py", line 566, in pwc_dc_net
    model = PWCDCNet()
  File "/content/MVIMP/third_party/DAIN/PWCNet/PWCNet.py", line 166, in __init__
    xx = torch.arange(0, W_MAX).view(1, -1).cuda().repeat(H_MAX, 1)
  File "/usr/local/lib/python3.6/dist-packages/torch/cuda/__init__.py", line 162, in _lazy_init
    torch._C._cuda_init()
RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:51
ffmpeg -hide_banner -loglevel warning -threads 4 -r 47.96 -f image2 -i /content/MVIMP/Data/Input/%10d.png -y -c:v libx264 -preset slow -crf 8 /content/MVIMP/Data/Output/test-47.96.mp4
[image2 @ 0x55a31a2fa000] Could find no file with path '/content/MVIMP/Data/Input/%10d.png' and index in the range 0-4
/content/MVIMP/Data/Input/%10d.png: No such file or directory
The image-video fusion job is done.

it's say the image-video function is done but there is nothing on MVIMP/Data/Output

CyFeng16 commented 4 years ago

Hi mate,

If you had noticed that RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:51 , you will understand that that running colab env is CPU only. It would works when you change colab env to GPU.

Have fun.

CyFeng16 commented 4 years ago

@Richie-Z Have you successfully used it? :)

Rishi5583 commented 3 years ago

I have run in GPU , but it fails ,is there any version issue ? 0% 0/10906 [00:00<?, ?it/s]error in correlation_forward_cuda_kernel: no kernel image is available for execution on the device Traceback (most recent call last): File "vfi_helper.py", line 204, in input_dir=args.src, output_dir=args.dst, time_step=args.time_step, File "vfi_helper.py", line 45, in continue_frames_insertion_helper time_step=time_step, File "vfi_helper.py", line 81, in frames_insertion_helper ym_0_0 = model_inference_helper(im_0[:, 0::2, 0::2], im_1[:, 0::2, 0::2]) File "vfi_helper.py", line 150, in model_inference_helper ys, , _ = model(torch.stack((x_0, x_1), dim=0)) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, kwargs) File "/content/MVIMP/third_party/DAIN/networks/DAIN_slowmotion.py", line 170, in forward self.flownets, cur_offset_input, time_offsets=time_offsets File "/content/MVIMP/third_party/DAIN/networks/DAIN_slowmotion.py", line 268, in forward_flownets input File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, *kwargs) File "/content/MVIMP/third_party/DAIN/PWCNet/PWCNet.py", line 241, in forward corr6 = self.corr(c16, c26) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) File "/content/MVIMP/third_party/DAIN/PWCNet/correlation_package_pytorch1_0/correlation.py", line 106, in forward )(input1, input2) File "/content/MVIMP/third_party/DAIN/PWCNet/correlation_package_pytorch1_0/correlation.py", line 45, in forward self.corr_multiply, RuntimeError: CUDA call failed (correlation_forward_cuda at correlation_cuda.cc:80)

Rishi5583 commented 3 years ago

0% 0/10906 [00:28<?, ?it/s] Traceback (most recent call last): File "inference_dain.py", line 83, in file_order(src=output_data_dir, dst=input_data_dir) File "/content/MVIMP/mvimp_utils/file_op_helper.py", line 16, in file_order os.path.join(src, frames_list[i]), os.path.join(dst, f"{i + 1:010d}.png"), File "/usr/lib/python3.6/shutil.py", line 245, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.6/shutil.py", line 120, in copyfile with open(src, 'rb') as fsrc: IsADirectoryError: [Errno 21] Is a directory: '/content/MVIMP/Data/Output/.ipynb_checkpoints'

CyFeng16 commented 3 years ago

0% 0/10906 [00:28<?, ?it/s] Traceback (most recent call last): File "inference_dain.py", line 83, in file_order(src=output_data_dir, dst=input_data_dir) File "/content/MVIMP/mvimp_utils/file_op_helper.py", line 16, in file_order os.path.join(src, frames_list[i]), os.path.join(dst, f"{i + 1:010d}.png"), File "/usr/lib/python3.6/shutil.py", line 245, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.6/shutil.py", line 120, in copyfile with open(src, 'rb') as fsrc: IsADirectoryError: [Errno 21] Is a directory: '/content/MVIMP/Data/Output/.ipynb_checkpoints'

Unfortunately, the above error occurs when you try to proceed using or reopen the previous COLAB session. A Jupyter temp file ipynb_checkpoints was created when you took those actions. Kill the current session and open a new one would help.

CyFeng16 commented 3 years ago

@Rishi5583 Refer to #21 :)

Rishi5583 commented 3 years ago

Thanks , But do you have any Idea , how to set FPS , from the video creation ? , output frames to match with video fps from input ?

CyFeng16 commented 3 years ago

@Rishi5583 It's all depends on you :) DAIN provides the basic ability to Interpolate the video frame, which means you can get whatever FPS you want below the Interpolated one. (using FFmpeg or other software)