vt-vl-lab / FGVC

[ECCV 2020] Flow-edge Guided Video Completion
Other
1.55k stars 263 forks source link

RuntimeError: Given groups=1, weight of size [64, 3, 7, 7], expected input[2, 4, 480, 640] to have 3 channels, but got 4 channels instead #26

Closed Dolamin792 closed 3 years ago

Dolamin792 commented 3 years ago

I Have been trying to run this on colab, i have 3 frames and running the video_extrapolation mode, i cant run this on a higher resolution ex: 960x720 because CUDA runs out of memory, when i downscaled for 640x480 it gave me a new error.

Traceback (most recent call last): File "video_completion.py", line 613, in main(args) File "video_completion.py", line 576, in main video_completion_seamless(args) File "video_completion.py", line 402, in video_completion_seamless corrFlowF = calculate_flow(args, RAFT_model, video, 'forward') File "video_completion.py", line 120, in calculateflow , flow = model(image1, image2, iters=20, test_mode=True) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, kwargs) File "/content/FGVC/RAFT/raft.py", line 101, in forward fmap1, fmap2 = self.fnet([image1, image2]) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, *kwargs) File "/content/FGVC/RAFT/extractor.py", line 176, in forward x = self.conv1(x) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(input, kwargs) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 419, in forward return self._conv_forward(input, self.weight) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 416, in _conv_forward self.padding, self.dilation, self.groups) RuntimeError: Given groups=1, weight of size [64, 3, 7, 7], expected input[2, 4, 480, 640] to have 3 channels, but got 4 channels instead

gaochen315 commented 3 years ago

It seems like your images have 4 channels. Can you try removing the alpha channel?

Dolamin792 commented 3 years ago

It seems like your images have 4 channels. Can you try removing the alpha channel?

That fixed the problem, Thanks!