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

add import to fix #707

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

add import to fix #707

wants to merge 1 commit into from

Conversation

kamata1729
Copy link

@kamata1729 kamata1729 commented Aug 27, 2020

I found a bug in imagenet models, and fix it

this bug can be confirmed with below code:

from nnabla.models.imagenet import ResNet18
model = ResNet18()
tmp = model(None)

this outputs:

~/Library/Python/3.7/lib/python/site-packages/nnabla/models/imagenet/resnet.py in __call__(self, input_var, use_from, use_up_to, training, force_global_pooling, check_global_pooling, returns_net, verbose)
     66 
     67         assert use_from is None, 'This should not be set because it is for forward compatibility.'
---> 68         input_var = self.get_input_var(input_var)
     69 
     70         callback = NnpNetworkPass(verbose)

~/Library/Python/3.7/lib/python/site-packages/nnabla/models/imagenet/base.py in get_input_var(self, input_var)
     76         default_shape = (1,) + self.input_shape
     77         if input_var is None:
---> 78             input_var = nn.Variable(default_shape)
     79         assert input_var.ndim == 4, "input_var must be 4 dimensions. Given {}.".format(
     80             input_var.ndim)

NameError: name 'nn' is not defined

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.

1 participant