hiddenlayer icon indicating copy to clipboard operation
hiddenlayer copied to clipboard

Possible to use with pytorch model generated by fastai?

Open lminer opened this issue 6 years ago • 2 comments

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.

lminer avatar Apr 26 '19 20:04 lminer

@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?

swaroopkml96 avatar Jul 18 '19 10:07 swaroopkml96

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

amitkayal avatar Aug 08 '19 10:08 amitkayal