brjathu / deepcaps

Official Implementation of "DeepCaps: Going Deeper with Capsule Networks" paper (CVPR 2019).
MIT License
151 stars 48 forks source link

ensemble.py:77: DeprecationWarning: `imresize` is deprecated! #9

Closed grische closed 5 years ago

grische commented 5 years ago

If you follow the installation instructions and install a current version of scipy, you will end up with the following error:

Traceback (most recent call last):
  File "ensemble.py", line 82, in <module>
    x_test64 = resize(x_test)
  File "ensemble.py", line 77, in resize
    resized = scipy.misc.imresize(data_set[i], (64, 64))
AttributeError: module 'scipy' has no attribute 'misc'

after changing import scipy to import scipy.misc, the error will change to

Traceback (most recent call last):
  File "ensemble.py", line 82, in <module>
    x_test64 = resize(x_test)
  File "ensemble.py", line 77, in resize
    resized = scipy.misc.imresize(data_set[i], (64, 64))
AttributeError: module 'scipy.misc' has no attribute 'imresize'

A potential workaround I found was downgrading manually to scipy-1.2, but it still give this huge warning:

ensemble.py:77: DeprecationWarning: `imresize` is deprecated!
`imresize` is deprecated in SciPy 1.0.0, and will be removed in 1.3.0.
Use Pillow instead: ``numpy.array(Image.fromarray(arr).resize())``.
  resized = scipy.misc.imresize(data_set[i], (64, 64))

The DeprecationWarning should probably be fixed.

grische commented 5 years ago

@brjathu it might be better to fix the DeprecationWarning, as this command has been deprecated already in SciPy 1.0.0.