MECLabTUDA / M3d-Cam

MIT License
306 stars 40 forks source link

Multiple inputs to model producing TypeError #31

Open aritche opened 1 year ago

aritche commented 1 year ago

Hi,

My model has multiple inputs, i.e. the forward method of the model has two arguments: fmri_input, anat_input. When I try to wrap the model with model = medcam.inject(model, ...etc), and do forward propagation with: model(fmri_input, anat_input), the script returns the error: "TypeError: forward() missing 1 required positional argument: 'anat_input'".

Is it possible to use medcam on a model that takes multiple inputs?

Thanks!

burhr2 commented 11 months ago

Hi, you can adapt the trick mentioned here to work with either multiple inputs, outputs or both.

yuanpengpeng commented 6 months ago

Hi,

My model has multiple inputs, i.e. the forward method of the model has two arguments: fmri_input, anat_input. When I try to wrap the model with model = medcam.inject(model, ...etc), and do forward propagation with: model(fmri_input, anat_input), the script returns the error: "TypeError: forward() missing 1 required positional argument: 'anat_input'".

Is it possible to use medcam on a model that takes multiple inputs?

Thanks!

Have you implemented it? I've encountered the same issue.