Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in Tensorboard's(PyTorch) add_graph

Tags:

I'm following this Pytorch's Tensorboard documentation.

I have the following code:

model = torchvision.models.resnet50(False)
writer.add_graph(model)

It throws the following error:

_ = model(*args) # don't catch, just print the error message

TypeError: ResNet object argument after * must be an iterable, not NoneType

I don't know what I'm doing wrong here!

like image 238
paul-shuvo Avatar asked Feb 01 '20 21:02

paul-shuvo


1 Answers

I had this problem too..

Passing an input_to_model parameter different from None solved the problem. However, I though it should be optional

dataiter = iter(trainloader)
images, labels = dataiter.next()
writer.add_graph(model, images)
like image 53
Bernardo Peters Avatar answered Sep 29 '22 08:09

Bernardo Peters