Describe the bug
When running the notebook StarDist_2D_ZeroCostDL4Mic, an error occurs due to the removal of the imsave function from the tifffile library in recent versions.
The error message
ImportError: cannot import name 'imsave' from 'tifffile' (/usr/local/lib/python3.11/dist-packages/tifffile/__init__.py)
This happens because imsave was removed in tifffile version 2025.2.18. The recommended replacement is imwrite.
To Reproduce
- Open and run the StarDist_2D_ZeroCostDL4Mic notebook.
- Execute first and second cells of the notebook that intalls and imports
imsave from tifffile.
- The error appears, preventing further execution.
Expected behavior
The notebook should execute without errors.
Desktop:
- OS: Windows 11 Enterprise
- Browser: tested both in Chrome and Opera
Additional context
- The issue is due to a breaking change in
tifffile: Release notes.
- A fix would be to replace
imsave with imwrite in the affected part of the notebook.
- Alternatively and as a quick fix, users can downgrade
tifffile using:
!pip install tifffile==2022.8.12
but updating the notebook to use imwrite is the best long-term fix.
Describe the bug
When running the notebook StarDist_2D_ZeroCostDL4Mic, an error occurs due to the removal of the imsave function from the tifffile library in recent versions.
The error message
This happens because
imsavewas removed intifffileversion 2025.2.18. The recommended replacement is imwrite.To Reproduce
imsavefromtifffile.Expected behavior
The notebook should execute without errors.
Desktop:
Additional context
tifffile: Release notes.imsavewithimwritein the affected part of the notebook.tifffileusing:!pip install tifffile==2022.8.12but updating the notebook to use imwrite is the best long-term fix.