Tensorboardx: AttributeError: 'function' object has no attribute 'graph'

Created on 21 Jul 2019  路  5Comments  路  Source: lanpa/tensorboardX

/home/znb/anaconda3/envs/pvNet/bin/python /home/znb/research/pvnet/demoGraph.py
Traceback (most recent call last):
File "/home/znb/research/pvnet/demoGraph.py", line 20, in
w.add_graph(LinearInLinear(), dummy_input, True)
File "/home/znb/anaconda3/envs/pvNet/lib/python3.6/site-packages/tensorboardX/writer.py", line 738, in add_graph
self._get_file_writer().add_graph(graph(model, input_to_model, verbose, **kwargs))
File "/home/znb/anaconda3/envs/pvNet/lib/python3.6/site-packages/tensorboardX/pytorch_graph.py", line 241, in graph
graph = trace.graph
AttributeError: 'function' object has no attribute 'graph'

Process finished with exit code 1

when i run the the demoGraph.py from the example of tensorBoardX. i meet this problem.
my pytorch is 0.4.1.
tensorboard 1.14.0
tensorboardx 1.8
tensorflow 1.14.0
tensorflow-estimator 1.14.0

Most helpful comment

thanks! when i convert the TBX to 1.4! the problem is missing!

All 5 comments

Your pytorch version is too old for TBX 1.8

thanks! when i convert the TBX to 1.4! the problem is missing!

File "demo_graph.py", line 20, in
w.add_graph(LinearInLinear(), dummy_input, True)
File "/home/devin/tensorboardX/examples/tensorboardX/writer.py", line 774, in add_graph
self._get_file_writer().add_graph(graph(model, input_to_model, verbose, **kwargs))
File "/home/devin/tensorboardX/examples/tensorboardX/pytorch_graph.py", line 249, in graph
graph = trace.graph
AttributeError: 'function' object has no attribute 'graph'

how to solve the problem?
I changed tensorboardx to 1.4 but it does not work.

File "demo_graph.py", line 20, in
w.add_graph(LinearInLinear(), dummy_input, True)
File "/home/devin/tensorboardX/examples/tensorboardX/writer.py", line 774, in add_graph
self._get_file_writer().add_graph(graph(model, input_to_model, verbose, **kwargs))
File "/home/devin/tensorboardX/examples/tensorboardX/pytorch_graph.py", line 249, in graph
graph = trace.graph
AttributeError: 'function' object has no attribute 'graph'

how to solve the problem?
I changed tensorboardx to 1.4 but it does not work.

with keras.backend.get_session.graph.as_default():
AttributeError: 'function' object has no attribute 'graph'

I get this error while executing my django project.
Please help me to clear this error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hrtang picture hrtang  路  4Comments

ZhengRui picture ZhengRui  路  7Comments

tcqiuyu picture tcqiuyu  路  6Comments

yaodi833 picture yaodi833  路  6Comments

iodncookie picture iodncookie  路  6Comments