Closed nanohanno closed 4 years ago
I face the same problem :/
Hey @jonas154, have you tried out the proposed changes from #67 ?
Hey @nanohanno, sorry for the late response. I just tried out your fix and everything works now fine. Thanks for providing the fix!
@jonas154 still face this bug today Python 3.7 Pytorch 1.4 torchvision 0.5
@MoonBunnyZZZ have you tried the fix of @nanohanno
@MoonBunnyZZZ have you tried the fix of @nanohanno
the fix works now.thank you
Hey i have tried changing the code as proposed by @nanohanno , but i couldn't get it to work, am i missing something?? torch 1.5, and torchvision 0.6.
After viewing the doc, only pytorch 1.1 have this get_trace_graph so downgrade to pytorch 1.1 will help
Hey @level14taken ,
It seems like the error message still refers to the old version get_trace_graph
while showing your updated code. Maybe there is a problem with package installation? Maybe pip install directly from github?
@nanohanno, Nope the error still persists, even after direct installation from github,any other ideas that i can try out??
Sorry, I guess it has more to do with package installation than hiddenlayer itself. Maybe look into that direction. Also, I am not familiar with colab, don't know if that may also cause problems.
I am having the similar issue running hiddenlayer with PyTorch Nightly,
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-12-04717a98c7ee> in <module>
1 import hiddenlayer
----> 2 hiddenlayer.build_graph(LeNet5(), torch.zeros(1, 1, 32, 32))
~\anaconda3\lib\site-packages\hiddenlayer-0.2-py3.7.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\lib\site-packages\hiddenlayer-0.2-py3.7.egg\hiddenlayer\pytorch_builder.py in import_graph(hl_graph, model, args, input_names, verbose)
68
69 # Run the Pytorch graph to get a trace and generate a graph from it
---> 70 trace, out = torch.jit.get_trace_graph(model, args)
71 torch.onnx._optimize_trace(trace, torch.onnx.OperatorExportTypes.ONNX)
72 torch_graph = trace.graph()
AttributeError: module 'torch.jit' has no attribute 'get_trace_graph'
I believe this issue is now fixed thanks to https://github.com/waleedka/hiddenlayer/pull/67
system: Python 3.7.5 Pytorch 1.4 torchvision 0.5
code and error: import hiddenlayer as hl
model= vgg16(pretrained=True).features hl.build_graph(model, torch.zeros([1,3,224,224]))
" 69 # Run the Pytorch graph to get a trace and generate a graph from it ---> 70 trace, out = torch.jit.get_trace_graph(model, args) 71 torch.onnx._optimize_trace(trace, torch.onnx.OperatorExportTypes.ONNX) 72 torch_graph = trace.graph()"
AttributeError: module 'torch.jit' has no attribute 'get_trace_graph'
Context: Since Pytorch version 1.4 (this pull request) the function jit.get_trace_graph is private (jit._get_trace_graph).