waleedka / hiddenlayer

Neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.
MIT License
1.79k stars 266 forks source link

'torch._C.Value' object has no attribute 'uniqueName' #64

Closed woodg07 closed 4 years ago

woodg07 commented 4 years ago
import torch
import torchvision.models
import hiddenlayer as hl
# VGG16 with BatchNorm
model = torchvision.models.vgg16()

# Build HiddenLayer graph
# Jupyter Notebook renders it automatically
hl.build_graph(model, torch.zeros([1, 3, 224, 224]))

python 3.6 torch 1.3.1 hl 0.2

AttributeError Traceback (most recent call last)

in 7 # Build HiddenLayer graph 8 # Jupyter Notebook renders it automatically ----> 9 hl.build_graph(model, torch.zeros([1, 3, 224, 224])) ~/anaconda3/envs/py36/lib/python3.6/site-packages/hiddenlayer-0.2-py3.6.egg/hiddenlayer/graph.py in build_graph(model, args, input_names, transforms, framework_transforms) 141 from .pytorch_builder import import_graph, FRAMEWORK_TRANSFORMS 142 assert args is not None, "Argument args must be provided for Pytorch models." --> 143 import_graph(g, model, args) 144 elif framework == "tensorflow": 145 from .tf_builder import import_graph, FRAMEWORK_TRANSFORMS ~/anaconda3/envs/py36/lib/python3.6/site-packages/hiddenlayer-0.2-py3.6.egg/hiddenlayer/pytorch_builder.py in import_graph(hl_graph, model, args, input_names, verbose) 88 shape = get_shape(torch_node) 89 # Add HL node ---> 90 hl_node = Node(uid=pytorch_id(torch_node), name=None, op=op, 91 output_shape=shape, params=params) 92 hl_graph.add_node(hl_node) ~/anaconda3/envs/py36/lib/python3.6/site-packages/hiddenlayer-0.2-py3.6.egg/hiddenlayer/pytorch_builder.py in pytorch_id(node) 43 # After ONNX simplification, the scopeName is not unique anymore 44 # so append node outputs to guarantee uniqueness ---> 45 return node.scopeName() + "/outputs/" + "/".join([o.uniqueName() for o in node.outputs()]) 46 47 ~/anaconda3/envs/py36/lib/python3.6/site-packages/hiddenlayer-0.2-py3.6.egg/hiddenlayer/pytorch_builder.py in (.0) 43 # After ONNX simplification, the scopeName is not unique anymore 44 # so append node outputs to guarantee uniqueness ---> 45 return node.scopeName() + "/outputs/" + "/".join([o.uniqueName() for o in node.outputs()]) 46 47 AttributeError: 'torch._C.Value' object has no attribute 'uniqueName'
theDweeb commented 4 years ago

Changing uniqueName to debugName worked for me!

mydmdm commented 4 years ago

try to fix it in #69

jaewooklee93 commented 4 years ago

Is it still not be fixed?

I should downgrade my PyTorch 1.3.1 to older one..

sizhky commented 4 years ago

code ran with latest pytorch when I cloned and pip installed #69

waleedka commented 4 years ago

Issue fixed and verified on PyTorch 1.5