idealo / imagededup

😎 Finding duplicate images made easy!

Home Page:https://idealo.github.io/imagededup/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail to call CNN()

g-lks opened this issue · comments

commented

Unable to use CNN method:

imagededup compiled from source version: '0.2.4'
from pip install imagededup=='0.2.2' is also "broken"

WARNING:tensorflow:From /home/georgeg/.pyenv/versions/img/lib/python3.7/site-packages/tensorflow/python/ops/init_ops.py:1251: calling VarianceScaling.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/georgeg/imagededup/imagededup/methods/cnn.py", line 55, in __init__
    self._build_model()
  File "/home/georgeg/imagededup/imagededup/methods/cnn.py", line 63, in _build_model
    input_shape=(224, 224, 3), include_top=False, pooling='avg'
  File "/home/georgeg/.pyenv/versions/img/lib/python3.7/site-packages/tensorflow/python/keras/applications/__init__.py", line 70, in wrapper
    return base_fun(*args, **kwargs)
  File "/home/georgeg/.pyenv/versions/img/lib/python3.7/site-packages/tensorflow/python/keras/applications/mobilenet.py", line 32, in MobileNet
    return mobilenet.MobileNet(*args, **kwargs)
  File "/home/georgeg/.pyenv/versions/img/lib/python3.7/site-packages/keras_applications/mobilenet.py", line 296, in MobileNet
    model.load_weights(weights_path)
  File "/home/georgeg/.pyenv/versions/img/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py", line 162, in load_weights
    return super(Model, self).load_weights(filepath, by_name)
  File "/home/georgeg/.pyenv/versions/img/lib/python3.7/site-packages/tensorflow/python/keras/engine/network.py", line 1424, in load_weights
    saving.load_weights_from_hdf5_group(f, self.layers)
  File "/home/georgeg/.pyenv/versions/img/lib/python3.7/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 711, in load_weights_from_hdf5_group
    original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
commented

Fix: pip install 'h5py==2.10.0' --force-reinstall