mapmanager / napari-tracing

A Napari plugin to perform brightest path tracing.
GNU General Public License v3.0
5 stars 1 forks source link

Getting a hard crash of Napari when using napari-tracing? #9

Open cudmore opened 1 year ago

cudmore commented 1 year ago

I am getting a hard crash of Napari when using the napari-tracing plugin?

I am working on an M1 (arm64) macOS laptop. This might be the cause? idk, just an optimistic guess.

The following recipe to reproduce should be run on an x86 macOS and a Windows machine to see if the errors/crashes can be replicated.

Install napari

Following the install instructions in their github repo readme at https://github.com/napari/napari

conda create -y -n napari-env -c conda-forge python=3.9
conda activate napari-env
python -m pip install "napari[all]"

Run napari gui from the command line

napari

Install the napari-tracing plugin

Use menu Plugins - Install/Uninstall Plugins ... to install napari-tracing 1.0.1

Quit napari and restart from the command line.

Use the newly installed plugin

WARNING  Module /Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/brightest_path_lib/cost/reciprocal_transonic.py 
         has not been compiled for Transonic-Pythran                                                                                      
19:17:43 WARNING Module /Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/brightest_path_lib/cost/reciprocal_transonic.py has not been compiled for Transonic-Pythran
   INFO _widget.py set_img_layer_for_tracing() line:230 - using MAX_rr30a_s0_ch2_21_43_8_bit as our layer for tracing the image
   INFO _widget.py set_img_layer_for_tracing() line:233 - Available layers: [<Image layer 'MAX_rr30a_s0_ch2_21_43_8_bit' at 0x17c3dfd30>]
   INFO _widget.py set_img_layer_for_tracing() line:245 - selected new image layer for tracing MAX_rr30a_s0_ch2_21_43_8_bit
   INFO _widget.py slot_new_layer_inserted() line:318 - New layer "[<Image layer 'MAX_rr30a_s0_ch2_21_43_8_bit' at 0x17c3dfd30>, <Points layer 'MAX_rr30a_s0_ch2_21_43_8_bit_terminal_points_layer' at 0x17c3c44f0>]" was inserted at index 1
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
   INFO _widget.py set_img_layer_for_tracing() line:230 - using MAX_rr30a_s0_ch2_21_43_8_bit as our layer for tracing the image
   INFO _widget.py set_img_layer_for_tracing() line:233 - Available layers: [<Image layer 'MAX_rr30a_s0_ch2_21_43_8_bit' at 0x177f4dd30>]
   INFO _widget.py set_img_layer_for_tracing() line:245 - selected new image layer for tracing MAX_rr30a_s0_ch2_21_43_8_bit
   INFO _widget.py slot_new_layer_inserted() line:318 - New layer "[<Image layer 'MAX_rr30a_s0_ch2_21_43_8_bit' at 0x177f4dd30>, <Points layer 'MAX_rr30a_s0_ch2_21_43_8_bit_terminal_points_layer' at 0x1818ebb50>]" was inserted at index 1
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
/Users/cudmore/opt/miniconda3/envs/napari-env/lib/python3.9/site-packages/napari/layers/base/base.py:1632: RuntimeWarning: invalid value encountered in cast!
   INFO _widget.py slot_points_data_change() line:459 - Inside slot_points_data_change
   INFO _widget.py slot_points_data_change() line:472 - new point added
   INFO utils.py get_diff() line:52 - ([0], array([[266.79836511, 202.27105849]]))
   INFO _widget.py slot_points_data_change() line:480 - Making (266.7983651059234, 202.27105848754292) as our start
   INFO _widget.py slot_points_data_change() line:459 - Inside slot_points_data_change
   INFO _widget.py slot_points_data_change() line:472 - new point added
   INFO utils.py get_diff() line:52 - ([1], array([[245.77534259, 320.62288893]]))
   INFO _widget.py slot_points_data_change() line:486 - Making (245.77534259392132, 320.6228889254806) as our end
cudmore commented 1 year ago

Seems to be an arm64 problem. When I run the same recipe on an x86 macOS laptop I do not get the error/crash and the tracing works.

After install the brightest-path-lib plugin and running napari from the command line I do see the following warning (on both arm64 and x86)

WARNING  Module /Users/cudmore/miniconda3/envs/napari-env/lib/python3.9/site-packages/brightest_path_lib/cost/reciprocal_transonic.py has not been compiled for Transonic-Pythran                                  
09:34:22 WARNING Module /Users/cudmore/miniconda3/envs/napari-env/lib/python3.9/site-packages/brightest_path_lib/cost/reciprocal_transonic.py has not been compiled for Transonic-PythranWARNING  Module /Users/cudmore/miniconda3/envs/napari-env/lib/python3.9/site-packages/brightest_path_lib/cost/reciprocal_transonic.py has not been compiled for Transonic-Pythran                                  
09:34:22 WARNING Module /Users/cudmore/miniconda3/envs/napari-env/lib/python3.9/site-packages/brightest_path_lib/cost/reciprocal_transonic.py has not been compiled for Transonic-Pythran