jlevy44 / PathFlow-MixMatch

Don't mix, match! Simple utilities for improved registration of Histopathology Whole Slide Images.
10 stars 6 forks source link

Installation Errors #20

Closed lgn211 closed 3 years ago

lgn211 commented 3 years ago

When it is Installing, terminal shows:

Collecting torch
  Using cached torch-0.1.2.post2.tar.gz (128 kB)
ERROR: Could not find a version that satisfies the requirement airlab (from pathflow-mixmatch==0.1) (from versions: none)
ERROR: No matching distribution found for airlab (from pathflow-mixmatch==0.1)
lgn211 commented 3 years ago

I failed to install on MacOS, and I now installed successfully on Ubuntu, but terminal shows: Command not found, when typing in pathflow-mixmatch.

jlevy44 commented 3 years ago

Hmm I'm not sure why that would happen. Are you using conda? Can you print the output from the installation and subsequent command call?

jlevy44 commented 3 years ago

You may also want to try installing this branch, though it is experimental: https://github.com/jlevy44/PathFlow-MixMatch/tree/fix_nonlinear_memory_issues

lgn211 commented 3 years ago

You may also want to try installing this branch, though it is experimental: https://github.com/jlevy44/PathFlow-MixMatch/tree/fix_nonlinear_memory_issues

Thanks, I have fixed all problem now, it is due to Python version so that all dependencies cannot be installed properly. It must be Python 3.7 or lower, but I was using Python 3.9.

lgn211 commented 3 years ago

But when I try minimal usage, new problem occured: test % pathflow-mixmatch register_images --im1 A.png --im2 B.png --fix_rotation False --output_dir output_registered_images/ --gpu_device 0 --transform_type similarity --lr 0.01 --iterations 1000 --min_object_size 50000 Traceback (most recent call last): File "/Users/.../miniconda3/bin/pathflow-mixmatch", line 5, in from pathflow_mixmatch.cli import main File "/Users/.../miniconda3/lib/python3.7/site-packages/pathflow_mixmatch/cli.py", line 21, in import torch as th File "/Users/...miniconda3/lib/python3.7/site-packages/torch/init.py", line 81, in from torch._C import * ImportError: dlopen(/Users/.../miniconda3/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so, 9): Symbol not found: _mkl_blas_caxpy Referenced from: /Users/.../miniconda3/lib/python3.7/site-packages/torch/lib/../../../../libmkl_intel_lp64.dylib Expected in: flat namespace in /Users/.../miniconda3/lib/python3.7/site-packages/torch/lib/../../../../libmkl_intel_lp64.dylib

lgn211 commented 3 years ago

It seems won't work with tiff format, I got the following issues when trying to run on an Ubuntu machine:

$ pathflow-mixmatch register_images --im1 1.tif --im2 2.tif --fix_rotation False --output_dir output_registered_images/ --gpu_device -1 --transform_type similarity --lr 0.01 --iterations 10 --min_object_size 50 Loading images. Locating Sections. Traceback (most recent call last): File "/home/.../.local/bin/pathflow-mixmatch", line 8, in sys.exit(main()) File "/home/.../.local/lib/python3.8/site-packages/pathflow_mixmatch/cli.py", line 577, in main fire.Fire(Commands) File "/home/.../.local/lib/python3.8/site-packages/fire/core.py", line 138, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/home/.../.local/lib/python3.8/site-packages/fire/core.py", line 463, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/home/.../.local/lib/python3.8/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/home/.../.local/lib/python3.8/site-packages/pathflow_mixmatch/cli.py", line 549, in register_images registerimages(im1_fname=im1, File "/home/.../.local/lib/python3.8/site-packages/pathflow_mixmatch/cli.py", line 400, in registerimages mask,labels=label_objects(im1, connectivity=connectivity, min_object_size=min_object_size, apply_watershed=apply_watershed) File "/home/.../.local/lib/python3.8/site-packages/pathflow_mixmatch/cli.py", line 46, in label_objects BW = (cv2.cvtColor(I, cv2.COLOR_BGR2GRAY)<threshold).astype(bool) cv2.error: OpenCV(4.4.0) /tmp/pip-req-build-99ib2vsi/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

jlevy44 commented 3 years ago

Hmm, that error suggests that your image path may have not been specified or loaded properly by opencv. It is relatively straightforward to support other image formats if you are interested in PR'ing. Seems like since you were able to install the package, I'll close this issue but feel free to open another for help with running the package or bugs.

leoblazar commented 3 years ago

Hello, I am experiencing the same issue under Ubuntu after running pip install pathflow-mixmatch, I get the error ERROR: Could not find a version that satisfies the requirement airlab (from pathflow-mixmatch) ERROR: No matching distribution found for airlab. Any idea ?

AntoineRibault commented 3 years ago

I am also experiencing the same issue:

ERROR: Could not find a version that satisfies the requirement airlab (from pathflow-mixmatch) ERROR: No matching distribution found for airlab

As suggested above, I have downgraded python 3.8 to python 3.7.10 (python 3.7), but the error persists...

Looking for ideas

leoblazar commented 3 years ago

@RibaultEPFL I managed to install airlab by doing this : pip install git+https://github.com/airlab-unibas/airlab.git cd airlab python setup.py install Hope this helps !

AntoineRibault commented 3 years ago

@leoblazar finally worked! Thank you!