Repository navigation
Colab inference demo incompatible with current MONAI and NumPy #119
Description
Activity
- linked a pull request that will close this issueUpgrade python support to 3.10-3.12, fix deprecation errors #120
on May 19, 2026 Hello @msayr,
Thanks a lot for reporting; I’m currently updating the package to run properly on Python 3.12 and to fix several deprecated/old calls, including the
newshapeissue.The
SwinUNETR.__init__() got multiple values for argument 'in_channels'error looks related to MONAI API/version compatibility, so I’m checking that as part of the update as well. In my limited local testing, the plugin is now running reasonably well with recent napari/MONAI versions, but I remember this being broken by a MONAI update, they might have fixed it in a subsequent release however as I got it to run locally. Will investigate this further.Thanks again!
Best,
CyrilClosed automatically by #120, re-opening until released/fix is confirmed
Hello @msayr,
Version 0.2.4 is now live, which moves the supported Python versions to 3.10-3.12.
This fixes all deprecation errors, and I've confirmed that all models run properly locally.
Please let me know if it still fails on Colab with the latest!Thanks again,
CyrilHi @C-Achard thank you very much for the prompt response! I just tested the notebook and it looks like pyclesperanto is required but now missing:
# @title Load libraries import napari_cellseg3d from tifffile import imread from pathlib import Path from napari_cellseg3d.dev_scripts import remote_inference as cs3d from napari_cellseg3d.utils import LOGGER as logger import logging logger.setLevel(logging.INFO)output:
_/usr/local/lib/python3.12/dist-packages/pyclesperanto/__init__.py:29: RuntimeWarning: No pyclesperanto backend installed. Install one with: pip install pyclesperanto[opencl] # for OpenCL pip install pyclesperanto[cuda] # for CUDA pip install pyclesperanto[metal] # for Metal pip install pyclesperanto[all] # for both warnings.warn(_###########
demo_image_path = "/content/CellSeg3D/examples/c5image.tif" demo_image = imread(demo_image_path) inference_config = cs3d.CONFIG post_process_config = cs3d.PostProcessConfig() # select cle device for colab import pyclesperanto_prototype as cle cle.select_device("cupy")output:
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) [/tmp/ipykernel_5093/3519197974.py](https://localhost:8080/#) in <cell line: 0>() 4 post_process_config = cs3d.PostProcessConfig() 5 # select cle device for colab ----> 6 import pyclesperanto_prototype as cle 7 cle.select_device("cupy") ModuleNotFoundError: No module named 'pyclesperanto_prototype' --------------------------------------------------------------------------- NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt. To view examples of installing some common dependencies, click the "Open Examples" button below. ---------------------------------------------------------------------------Hi @msayr,
Yes, apologies, we are no longer using the prototype version, this should work by removing the
_prototypesuffix.There was a small issue with the release that required immediate attention, I will check the Colab notebook more thoroughly soon.
Best,
CyrilReacted by Marcel SayreOkay, the issue was a bit sneakier: the Open in Colab URL was pointing to the
MMathisLabfork instead of this repo, so it was not showing the latest version.I will PR a new version with uv, check it works fine, and get back to you!
- linked a pull request that will close this issueUpdate Colab demo notebook #128
on May 21, 2026 @msayr Here is the link to the updated notebook:
https://colab.research.google.com/github/AdaptiveMotorControlLab/CellSeg3D/blob/main/notebooks/Colab_inference_demo.ipynbLet me know if there are any issues! Thanks again.
Hi there,
I was trying out the Colab inference notebook ([here])(https://colab.research.google.com/github/MMathisLab/CellSeg3d/blob/main/Notebooks/Colab_inference_demo.ipynb#scrollTo=IFbmZ3_zAm-1) and I've gotten the following error. All original code above this line ran without error:
Changing numpy and monai versions solved the issue for me:
NumPy: 2.4.6
MONAI: 1.3.2
Then updating reshape to shape to match different numpy version: