KitwareMedical / tensorboard-plugin-3d

https://tensorboardplugin3d.readthedocs.io/en/latest/
33 stars 4 forks source link

ZeroDivisionError #69

Open casperdcl opened 1 week ago

casperdcl commented 1 week ago

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 commented 1 week ago

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.