PyTorch - Tensorboard - keyword attribute 'name' has the wrong type

Am working on getting Tensorboard and Pytorch working. Have been following the tutorial at https://pytorch.org/tutorials/intermediate/tensorboard_tutorial.html. However, I cannot get past the error RuntimeError: required keyword attribute ‘name’ has the wrong type. (See full dump below). Any suggestions. Thanks

I am on Anaconda with Python 3.7.5/ Torch 1.3.1 and the following Tensorboard
tensorboard 2.0.2
tensorflow 2.0.0
tensorflow-estimator 2.0.1
termcolor 1.1.0
testpath 0.4.4
torch 1.3.1
torchvision 0.4.2

Conda Info
conda version : 4.8.0
conda-build version : 3.18.11
python version : 3.7.4.final.0
virtual packages : __osx=10.15.2
base environment : /usr/local/anaconda3 (writable)
package cache : /usr/local/anaconda3/pkgs
/Users/jph/.conda/pkgs
envs directories : /usr/local/anaconda3/envs
/Users/jph/.conda/envs
platform : osx-64
user-agent : conda/4.8.0 requests/2.22.0 CPython/3.7.4 Darwin/19.2.0 OSX/10.15.2
UID:GID : 501:20
netrc file : None
offline mode : False

Error Message
File “/Users/jph/Documents/tmp/torch/cnn/CNNNet.py”, line 174, in
writer.add_graph(net, images)

File “/usr/local/anaconda3/envs/pyt/lib/python3.7/site-packages/torch/utils/tensorboard/writer.py”, line 682, in add_graph
self._get_file_writer().add_graph(graph(model, input_to_model, verbose))

File “/usr/local/anaconda3/envs/pyt/lib/python3.7/site-packages/torch/utils/tensorboard/_pytorch_graph.py”, line 243, in graph
list_of_nodes = parse(graph, args)

File “/usr/local/anaconda3/envs/pyt/lib/python3.7/site-packages/torch/utils/tensorboard/_pytorch_graph.py”, line 212, in parse
nodes_py.append(NodePyOP(node))

File “/usr/local/anaconda3/envs/pyt/lib/python3.7/site-packages/torch/utils/tensorboard/_pytorch_graph.py”, line 90, in init
self.attributes = str({k: node_cpp[k] for k in node_cpp.attributeNames()}).replace("’", ’ ')

File “/usr/local/anaconda3/envs/pyt/lib/python3.7/site-packages/torch/utils/tensorboard/_pytorch_graph.py”, line 90, in
self.attributes = str({k: node_cpp[k] for k in node_cpp.attributeNames()}).replace("’", ’ ')

File “/usr/local/anaconda3/envs/pyt/lib/python3.7/site-packages/torch/onnx/utils.py”, line 731, in _node_getitem
return getattr(self, sel)(k)

RuntimeError: required keyword attribute ‘name’ has the wrong type

2 Likes

Same issue here… can anyone help how to fix this issue?