tensorboard-plugin-3d icon indicating copy to clipboard operation
tensorboard-plugin-3d copied to clipboard

ZeroDivisionError

Open casperdcl opened this issue 1 year ago • 1 comments

I have the same issue as #61 & #64 (and likely #62 & #63):

File "/opt/conda/lib/python3.12/site-packages/tensorboard_plugin_3d/plugin.py", line 173, in _find_next_images
  self.current_run = (int(idx) - 1) % len(self._all_runs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ZeroDivisionError: integer modulo by zero

I'm using SyneRBI/PETRIC@16393ed; effectively:

monai.visualize.plot_2d_or_3d_image(np.clip(nchwd, 0, 1), step, tbX_sw, tag='image')

Note that the "Images" tab shows the GIF properly.

But the "3D" tab doesn't display, and forcefully loading the 3D plugin produces the ZeroDivisionError in tensorboard's logs.

casperdcl avatar Sep 18 '24 19:09 casperdcl

I even tried applying a patch to tensorboard_plugin_3d/plugin.py:

99c99
<             if tag.startswith('image'):
---
>             if 'image' in tag:
101c101
<             elif tag.startswith('label'):
---
>             elif 'label' in tag:
195c195
<                         tag.startswith('image') or tag.startswith('label')):
---
>                         'image' in tag or 'label' in tag):

but that didn't work.

casperdcl avatar Sep 18 '24 19:09 casperdcl