tensorwatch icon indicating copy to clipboard operation
tensorwatch copied to clipboard

AttributeError: 'torch._C.Value' object has no attribute 'debugName'

Open LiangGaoUser opened this issue 4 years ago • 2 comments

import tensorwatch as tw
import torchvision.models
alexnet_model = torchvision.models.alexnet()
tw.draw_model(alexnet_model, [1, 3, 224, 224])

**--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in 1 alexnet_model = torchvision.models.alexnet() ----> 2 tw.draw_model(alexnet_model, [1, 3, 224, 224])

E:\anaconda3\envs\torch_tensorwatch\lib\site-packages\tensorwatch_init_.py in draw_model(model, input_shape, orientation, png_filename) 33 def draw_model(model, input_shape=None, orientation='TB'): #orientation = 'LR' for landscpe 34 from .model_graph.hiddenlayer import graph ---> 35 g = graph.build_graph(model, input_shape, orientation=orientation) 36 return g 37

E:\anaconda3\envs\torch_tensorwatch\lib\site-packages\tensorwatch\model_graph\hiddenlayer\pytorch_draw_model.py in draw_graph(model, args)

E:\anaconda3\envs\torch_tensorwatch\lib\site-packages\tensorwatch\model_graph\hiddenlayer\pytorch_draw_model.py in draw_img_classifier(model, dataset, display_param_nodes, rankdir, styles, input_shape)

E:\anaconda3\envs\torch_tensorwatch\lib\site-packages\tensorwatch\model_graph\hiddenlayer\summary_graph.py in init(self, model, dummy_input, apply_scope_name_workarounds)

E:\anaconda3\envs\torch_tensorwatch\lib\site-packages\tensorwatch\model_graph\hiddenlayer\summary_graph.py in __add_param(self, n)

AttributeError: 'torch._C.Value' object has no attribute 'debugName'**

python 3.6 torch 1.1.0 torchvision 0.3.0 tensorwatch 0.9.0

I just use the simple example with the jupyter notebook , but it raise the error which confused me . I will be appreciate it if anyone can reply me with the solution to the problem.

LiangGaoUser avatar Sep 20 '20 09:09 LiangGaoUser

Aha , not long before i get the solution .

Cause :

        not install graphviz on my local computer and anaconda environment

Solution:

        Step one: install graphviz on the conda env with the pip install graphviz or conda install graphviz
        Step two: download and install graphviz from the [https://www2.graphviz.org/Packages/stable/windows/10/cmake/Release/x64/](url)
        Step three: init the graphviz in the local computer with the cmd doc -t
        Step four: Add C:\Program Files (x86)\Graphviz2.38\bin to User path
        Step five: Add C:\Program Files (x86)\Graphviz2.38\bin\dot.exe to System Path

LiangGaoUser avatar Sep 20 '20 12:09 LiangGaoUser

@hi can you be more specific about this step please? Step three: init the graphviz in the local computer with the cmd doc -t

aricsong1995 avatar Dec 02 '20 18:12 aricsong1995