a-PyTorch-Tutorial-to-Image-Captioning
a-PyTorch-Tutorial-to-Image-Captioning copied to clipboard
scipy.misc import imread, imresize removed 2019
No description provided. @piperino11 You can fix it by running follow commands to reinstall scipy version 1.1.0
pip uninstall scipy
orconda uninstall scipy
(if you use conda enviroment)pip install scipy==1.1.0
orconda install scipy==1.1.0
(if you use conda enviroment)
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
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)))
Yes!
pip install scipy==1.1.0
img = np.array(Image.open(impaths[i]))
img = cv2.resize(img, (256, 256))