# Variable no attribute 'creator'?

**URL:** <https://discuss.pytorch.org/t/variable-no-attribute-creator/2866>\
**Category:** Uncategorized\
**Created:** [May 11, 2017, 5:08am UTC](https://discuss.pytorch.org/t/variable-no-attribute-creator/2866 "2017-05-11T05:08:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EthanZhangYi](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ethanzhangyi/32/4190_2.png) [@EthanZhangYi](https://discuss.pytorch.org/u/EthanZhangYi)\
**Post date:** [May 11, 2017, 5:08am UTC](https://discuss.pytorch.org/t/variable-no-attribute-creator/2866/1 "2017-05-11T05:08:01Z")

</div>

My pytorch version is `0.1.12+3a7e068` I want to visualize the DNN structure with [this code](https://github.com/szagoruyko/functional-zoo/blob/master/visualize.py) and [this ipython notebook](https://github.com/szagoruyko/functional-zoo/blob/master/resnet-18-export.ipynb), 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.

---

<div class="post-metadata">

**Author:** ![Teaonly](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/teaonly/32/3300_2.png) [@Teaonly](https://discuss.pytorch.org/u/Teaonly)\
**Post date:** [May 11, 2017, 8:09am UTC](https://discuss.pytorch.org/t/variable-no-attribute-creator/2866/2 "2017-05-11T08:09:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![albanD](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alband/32/215_2.png) [@albanD](https://discuss.pytorch.org/u/albanD)\
**Post date:** [May 11, 2017, 8:36am UTC](https://discuss.pytorch.org/t/variable-no-attribute-creator/2866/3 "2017-05-11T08:36:15Z")

</div>

The link that you sent [here](https://github.com/szagoruyko/functional-zoo/blob/master/visualize.py) 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.

---

<div class="post-metadata">

**Author:** ![EthanZhangYi](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ethanzhangyi/32/4190_2.png) [@EthanZhangYi](https://discuss.pytorch.org/u/EthanZhangYi)\
**Post date:** [May 11, 2017, 9:56am UTC](https://discuss.pytorch.org/t/variable-no-attribute-creator/2866/4 "2017-05-11T09:56:30Z")

</div>

Thanks!!! I forgot to update the code…

---

<div class="post-metadata">

**Author:** ![zhangbo2008](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@zhangbo2008](https://discuss.pytorch.org/u/zhangbo2008)\
**Post date:** [February 18, 2018, 3:22am UTC](https://discuss.pytorch.org/t/variable-no-attribute-creator/2866/5 "2018-02-18T03:22:48Z")

</div>

code:

```auto
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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![jpeg729](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/jpeg729/32/3464_2.png) [@jpeg729](https://discuss.pytorch.org/u/jpeg729)\
**Post date:** [February 18, 2018, 8:06am UTC](https://discuss.pytorch.org/t/variable-no-attribute-creator/2866/6 "2018-02-18T08:06:13Z")

</div>

> [@AttributeError: 'Variable' object has no attribute 'creator'](https://discuss.pytorch.org/t/attributeerror-variable-object-has-no-attribute-creator/10217/2):
>
> I think .creator was replaced with .grad\_fn in May as can be seen here: [https://github.com/pytorch/tutorials/pull/91/files](https://github.com/pytorch/tutorials/pull/91/files)
