cannot import name 'imresize' from 'scipy.misc'
时间: 2023-10-11 21:04:32 浏览: 149
Python错题本:from scipy.misc import imread 报错cannot import name imread 的解决方案
`imresize` function was removed from `scipy.misc` module in version 1.3.0. You can use `skimage.transform.resize` from scikit-image library instead.
Here is an example code:
```
from skimage.transform import resize
from imageio import imread
# Load image
img = imread('image.jpg')
# Resize image
resized_img = resize(img, (new_height, new_width), anti_aliasing=True)
```
Make sure to install scikit-image library if you haven't already:
```
pip install scikit-image
```
阅读全文