megvii-research / RealFlow

The official implementation of the ECCV 2022 Oral paper: RealFlow: EM-based Realistic Optical Flow Dataset Generation from Videos
Other
93 stars 11 forks source link

Error(s) in loading state_dict for DataParallel #11

Closed aaaaalun closed 1 year ago

aaaaalun commented 1 year ago

Hi,i meet this problem and how to solve it?

raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for DataParallel: Missing key(s) in state_dict: "module.fnet.conv1.weight"

use demo.py

Timer-x commented 1 year ago

modify line 118 may help you

model = RAFT(args) 
aaaaalun commented 1 year ago

thank! i have solved it, but i have a new error

raise exception TypeError: Caught TypeError in replica 1 on device 1. TypeError: forward() missing 2 required positional arguments: 'image1' and 'image2'

i think the problem is i have two gpu.

aaaaalun commented 1 year ago

thank!

i have solved it, but i have a new error

raise exception

TypeError: Caught TypeError in replica 1 on device 1. TypeError: forward() missing 2 required positional arguments: 'image1' and 'image2' i think the problem is i have two gpu.

i solve it by myself! modify " model = torch.nn.DataParallel(RAFT(args),device_ids=[0])"

aaaaalun commented 1 year ago

so many errors.................

File "D:\work\github\RealFlow-main\RealFlow-main\softmax_splatting\softsplat.py", line 416, in FunctionSoftsplat assert(strType in ['summation', 'average', 'linear', 'softmax', 'gumbel_softmax', 'max']) AssertionError

i have finished my program,but i can not get the results.

aaaaalun commented 1 year ago

so many errors.................

File "D:\work\github\RealFlow-main\RealFlow-main\softmax_splatting\softsplat.py", line 416, in FunctionSoftsplat

assert(strType in ['summation', 'average', 'linear', 'softmax', 'gumbel_softmax', 'max']) AssertionError i have finished my program,but i can not get the results.

hhh,i solve it. python demo.py --model xx --save_path xx--iter xx --splatting max

aaaaalun commented 1 year ago

thanks for share!