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

ValueError on vgg16_bn unless I first train for one epoch #30

Open
austinmw opened this issue Feb 26, 2019 · 1 comment
Open

ValueError on vgg16_bn unless I first train for one epoch #30

austinmw opened this issue Feb 26, 2019 · 1 comment

Comments

@austinmw
Copy link

austinmw commented Feb 26, 2019

I'm able to build and display a graph right away on the torchvision alexnet model. But on the torchvision vgg16_bn model, if try to graph the model before training I get the error, ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 1024]) Even though I passed in hl.build_graph(model, torch.zeros((1,3,224,224).cuda()). If I train the model for 1 epoch, then I'm able to build and display the graph properly.

Edit: Actually the torchvision model copied exactly works, but if I create a fastai learner with this model (which removes the head and adds a custom head with adaptive pooling) then I get this issue.

Edit 2: if I set the model to eval mode before trying to graph it works

Any idea why this is the case?

@austinmw austinmw changed the title ValueError unless I train first ValueError on vgg16_bn unless I first train for one epoch Feb 26, 2019
@waleedka
Copy link
Owner

waleedka commented Mar 4, 2019

HiddenLayer is designed to take either a TensorFlow or a PyTorch model. Are you passing a FastAI object instead? That might be the 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

2 participants