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

ShapeAdaptor issue #1

Closed
freeman-1995 opened this issue Sep 5, 2020 · 4 comments
Closed

ShapeAdaptor issue #1

freeman-1995 opened this issue Sep 5, 2020 · 4 comments

Comments

@freeman-1995
Copy link

freeman-1995 commented Sep 5, 2020

hi, I git clone your project and run model_train.py, some problem occured

here are some errors:
Traceback (most recent call last):
File "model_training.py", line 421, in
main()
File "model_training.py", line 357, in main
if ShapeAdaptor.current_dim_true < args.limit_dim:
AttributeError: 'function' object has no attribute 'current_dim_true'

ShapeAdapto is defined in model_list but It's a function not a class, pls help to check the code is right

@lorenmt
Copy link
Owner

lorenmt commented Sep 5, 2020

Hi,

The code is correct.

The ShapeAdaptor.current_dim_true is defined in each network forward function. For example in VGG network, it's in line 174 - 176. This current_dim_true indicates the true output dimension dynamically updated for each iteration without the memory penalty, which is required to compute the corresponding penalty term to make it grow no more than the required limit_dim.

As such, this current_dim_true will only be available if we have at least one network pass using the forward function, i.e. running predict = model(data) at least once.

If you make sure you did not modify any part of the code, just try python model_training.py --gpu ID to test. It should give no error.

Hope it helps.

Sk.

@lorenmt
Copy link
Owner

lorenmt commented Sep 5, 2020

At the very first iteration, which current_limit_dim has not yet defined, python would directly give True if one of the conditions in or is true.

For example, if you try True or a even if a is not defined, it would output a True.

@freeman-1995
Copy link
Author

ok, Maybe I add some bugs while modified the code to distributed training

@lorenmt
Copy link
Owner

lorenmt commented Sep 10, 2020

Ok. Make sure the model has at least one pass on the training data.. Should be an easy fix.

@lorenmt lorenmt closed this as completed Sep 11, 2020
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

2 participants