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

Fixed params count and input size for multiple inputs #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajaynarayanan
Copy link

I faced three issues in the case of multiple inputs for the model,

  1. 'total_input_size' was incorrectly calculated by multiplying all the tuple values of 'input_size'. Suppose, model's forward function requires 2 params of say size [(3, 256, 128), (3, 256, 128)]. Total_input_size was calculated by multiplying all the values { 3x256x128x3x256x128 } instead of multiplying each tuples and adding them { 3x256x128 + 3x256x128 }. The issue was fixed by multiplying tuple and adding them.
  2. The 'total_params' were incorrectly calculated for multiple inputs case, fixed it by calculating from the model directly.
  3. 'summary[layer]["output_shape"]' needed to be flattened for computing 'total_output'. This was fixed by using 'funcy' package's flatten method.

@JayJJChen
Copy link

JayJJChen commented Sep 10, 2019

the Multiple Inputs demo error in read me is actually caused by this bug

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

Successfully merging this pull request may close these issues.

2 participants