brainglobe / cellfinder-napari

Efficient cell detection in large images using cellfinder in napari
https://brainglobe.info/documentation/cellfinder/index.html
BSD 3-Clause "New" or "Revised" License
24 stars 6 forks source link

cellfinder plugin crashes napari on Mac M1 #139

Closed nal10 closed 2 years ago

nal10 commented 2 years ago

Describe the bug Napari crashes and I get this in the terminal

zsh: illegal hardware instruction napari

To Reproduce click any of the options within the cellfinder plugin

Desktop (please complete the following information):

Additional context I know this has been a running issues. I have tried multiple solutions from closed threads on this page, but can't seem to solve this. Is this still an ongoing problem. My most recent attempt was:

https://forum.image.sc/t/napari-tensorflow-aicsimageio-stardist-care-n2v-pyclesperanto-running-native-on-apple-silicon-m1/55051/27?u=psobolewskiphd

adamltyson commented 2 years ago

Hi @nal10, I haven't seen this issue before. The plugin works fine on my M1 mac. Do other napari plugins work?

adamltyson commented 2 years ago

Have you seen this post?

nal10 commented 2 years ago

That was the underlying problem. After making sure miniconda was native, the solution that worked for me was:

conda create -n cellfinder python=3.9 conda activate cellfinder conda install -c apple tensorflow-deps python -m pip install tensorflow-macos python -m pip install tensorflow-metal pip install cellfinder-core conda install -c andfoy pyqt5-sip conda install -c conda-forge napari pip install cellfinder-napari
pip install numpy -U

The only remaining issue, which is separate, is that the cellfinder plugin does not scale to the window size. Running on a 13-in Macbook Pro 2020 and I have to change the display to 1680 x 1050 and hide the dock bar to barely have access to the run button.

adamltyson commented 2 years ago

Oh wow, that's not a simple installation! Sorry about this.

The window size is a known issue. There's a fix on it's way, I just haven't had time to finish testing it yet.

I'm going to leave this issue open until use on M1 is simplified.

adamltyson commented 2 years ago

Hi @nal10, would you mind trying the new version to see if the window size issue is fixed? There should be a scroll bar in the widget.

pip install cellfinder-napari==0.0.20rc0
niksirbi commented 2 years ago

Hi @nal10, based on your very helpful troubleshooting, I have created a conda environment file called napari-silicon.yml which should properly install both napari and and cellfinder-napari on M1/2 Macs. Try running conda env create -f napari-silicon.yml, followed by conda activate napari-silicon Let me know if that works for you.

adamltyson commented 2 years ago

The scrollbar issue is now fixed, and released in latest version.