Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple inputs to model producing TypeError #31

Open
aritche opened this issue Mar 7, 2023 · 2 comments
Open

Multiple inputs to model producing TypeError #31

aritche opened this issue Mar 7, 2023 · 2 comments

Comments

@aritche
Copy link

aritche commented Mar 7, 2023

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
Copy link

burhr2 commented Oct 10, 2023

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

@yuanpengpeng
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants