Skip to content

ImportError: cannot import name '_validate_lengths' #12

@GuidoBartoli

Description

@GuidoBartoli

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! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions