Variable no attribute 'creator'?

My pytorch version is 0.1.12+3a7e068 I want to visualize the DNN structure with this code and this ipython notebook, and got error:

AttributeError: creator

So it is not supported by pytorch-0.1.12? Are there any other tools to help visualize the CNN structure?

Thanks.

1 Like

I have the same question. I want to convert pytorch mode to our local library, so i need know how to iterate whole graph from a result tensor.

The link that you sent here has been updated by the author and now support new style autograd from pytorch master. It should work fine with the version from functional-zoo/master.

Thanks!!! I forgot to update the code…

code:

from torch.autograd import Variable
import torch
x = Variable(torch.ones(2, 2), requires_grad = True)
y = x + 2

import torch
from torch.autograd import Variable


# make_dot was moved to https://github.com/szagoruyko/pytorchviz


print (help(Variable))
print (y.creator)
exit()

problem:

Traceback (most recent call last):
  File "C:/Users/Administrator/Desktop/pytorch/PyTorch深度学习:60分钟入门(Translation).py", line 14, in <module>
    print (y.creator)
  File "D:\ProgramData\Anaconda3\lib\site-packages\torch\autograd\variable.py", line 67, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Variable' object has no attribute 'creator'

I have the same problem ,why?

2 Likes