a-PyTorch-Tutorial-to-Image-Captioning icon indicating copy to clipboard operation
a-PyTorch-Tutorial-to-Image-Captioning copied to clipboard

scipy.misc import imread, imresize removed 2019

Open piperino11 opened this issue 5 years ago • 5 comments

piperino11 avatar Jul 05 '19 14:07 piperino11

No description provided. @piperino11 You can fix it by running follow commands to reinstall scipy version 1.1.0 pip uninstall scipy or conda uninstall scipy (if you use conda enviroment) pip install scipy==1.1.0 or conda install scipy==1.1.0 (if you use conda enviroment)

TalenWang-AIcv avatar Aug 06 '19 02:08 TalenWang-AIcv

If you don't want to change the version of your scipy, you can use these two skimage functions to replace from scipy.misc import imread, imresize with from skimage.io import imread from skimage.transform import resize as imresize

Hans0124SG avatar Dec 12 '19 08:12 Hans0124SG

better change code like this

from PIL import Image

# img = imresize(img, (256, 256))  # comment out this line, change it to below
img = np.array(Image.fromarray(img).resize((256, 256)))

leewi9 avatar May 17 '20 15:05 leewi9

Yes! pip install scipy==1.1.0

fly-dragon211 avatar Sep 13 '20 04:09 fly-dragon211

img = np.array(Image.open(impaths[i]))

img = cv2.resize(img, (256, 256))

supriamir avatar Sep 27 '22 04:09 supriamir