Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

AttributeError: 'SummaryWriter' object has no attribute 'add_3d'

Open Nireil opened this issue 3 years ago • 4 comments

when I run the examples/python/visualization/tensorboard_pytorch.py, the error showed as follow: Traceback (most recent call last): File "/home/johnny.pan/OPEN3D/Open3D/examples/python/visualization/tensorboard_pytorch.py", line 206, in locals()eg File "/home/johnny.pan/OPEN3D/Open3D/examples/python/visualization/tensorboard_pytorch.py", line 85, in property_reference writer.add_3d('cube', cube_summary, step=step) AttributeError: 'SummaryWriter' object has no attribute 'add_3d'

Nireil avatar Feb 11 '22 08:02 Nireil

Hi @Nireil, Please fill out the bug reporting template with info about your system / environment (including PyTorch version). Please try with the latest development Python wheel from here: http://www.open3d.org/docs/latest/getting_started.html#development-version-pip and let us know if you still have this issue.

ssheorey avatar Feb 13 '22 05:02 ssheorey

I had the same problem,tried pytorch 1.8.1

angryhen avatar Mar 31 '22 07:03 angryhen

I had the same problem,tried pytorch 1.8.1

I have solved it! You need to add from open3d.visualization.tensorboard_plugin import summary before from open3d.visualization.tensorboard_plugin.util import to_dict_batch in the /examples/visualization/tensorboard_pytorch.py.

Nireil avatar Apr 12 '22 16:04 Nireil

Explanation

from open3d.visualization.tensorboard_plugin import summary

This line will run the MonkeyPatching method at below

https://github.com/isl-org/Open3D/blob/c3dfcbdc8d7cdf5603367b783b6d4a43fc934bd5/python/open3d/visualization/tensorboard_plugin/summary.py#L804-L810

It's really a kind of trick.

Be careful, most IDE will remove this line if you use some features like Auto-Import.

Matt-V50 avatar Jul 26 '22 15:07 Matt-V50