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

Possible to use with pytorch model generated by fastai? #36

Open
lminer opened this issue Apr 26, 2019 · 2 comments
Open

Possible to use with pytorch model generated by fastai? #36

lminer opened this issue Apr 26, 2019 · 2 comments

Comments

@lminer
Copy link

lminer commented Apr 26, 2019

Is it possible to use this on the models generated by fastai? If I run it on the pytorch model stored by the learner object, I get an error that it isn't a valid model.

ValueError: `model` input param must be a PyTorch, TensorFlow, or Keras-with-TensorFlow-backend model.
@swaroopkml96
Copy link

@lminer, I'm using fastai version 1.0.50 and

hl.build_graph(learn.model, torch.zeros([1, 3, 224, 224]).cuda())

works fine.

Can you confirm which version you're using?

@amitkayal
Copy link

I am getting following error while generating model image. It is not clear what I need to pass into torch.zeros([1, 3, 32, 32]..Documentation does not state from where values 1, 3, 32, 32 came from?

----> 1 hl.build_graph(learn1.model, torch.zeros([1, 3, 32, 32]).cuda())
2
3 currentDT = datetime.datetime.now()
4 print("Current time:", currentDT)

10 frames
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py in forward(self, input)
336 _pair(0), self.dilation, self.groups)
337 return F.conv2d(input, self.weight, self.bias, self.stride,
--> 338 self.padding, self.dilation, self.groups)
339
340

RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

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