Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name '_validate_lengths' #12

Open
GuidoBartoli opened this issue Jul 2, 2020 · 0 comments
Open

ImportError: cannot import name '_validate_lengths' #12

GuidoBartoli opened this issue Jul 2, 2020 · 0 comments

Comments

@GuidoBartoli
Copy link

Hi,
I followed the installation instruction for the CPU version, but when I launch python main_blind.py image.jpg noise.npz I receive the following error:

Traceback (most recent call last):
  File "main_blind.py", line 21, in <module>
    from noiseprint.noiseprint_blind import noiseprint_blind_file
  File "/home/guido/Projects/noiseprint/noiseprint/noiseprint_blind.py", line 17, in <module>
    from .post_em import EMgu_img, getSpamFromNoiseprint
  File "/home/guido/Projects/noiseprint/noiseprint/post_em.py", line 19, in <module>
    import skimage.morphology as ski
  File "/home/guido/.virtualenvs/np/lib/python3.6/site-packages/skimage/__init__.py", line 158, in <module>
    from .util.dtype import *
  File "/home/guido/.virtualenvs/np/lib/python3.6/site-packages/skimage/util/__init__.py", line 7, in <module>
    from .arraycrop import crop
  File "/home/guido/.virtualenvs/np/lib/python3.6/site-packages/skimage/util/arraycrop.py", line 8, in <module>
    from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name '_validate_lengths'

This is caused by an incompatible version of scikit-image and can be resolved by using its latest version.
Apart from tensorflow package, requirements.txt can safely use the latest versions of the other packages, some deprecation warnings are shown, but the code runs without problems.

pillow
numpy
pandas
scipy
scikit-image
scikit-learn
matplotlib
tensorflow==1.2.1
concurrent-iterator

Thanks for sharing your research code! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant