-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
调用paddle.image.load_image接口时报错 #7737
Comments
报错代码, |
@qingqing01 |
如果是这行报错, |
@qingqing01 |
@qingqing01 |
def resize_short(im, size):
"""
Resize an image so that the length of shorter edge is size.
Example usage:
.. code-block:: python
im = load_image('cat.jpg')
im = resize_short(im, 256)
:param im: the input image with HWC layout.
:type im: ndarray
:param size: the shorter edge size of image after resizing.
:type size: int
"""
assert im.shape[-1] == 1 or im.shape[-1] == 3
h, w = im.shape[:2]
h_new, w_new = size, size
if h > w:
h_new = size * h / w
else:
w_new = size * w / h
im = cv2.resize(im, (h_new, w_new), interpolation=cv2.INTER_CUBIC)
return im @yeyupiaoling 是不是调用了这个函数? 按照你的输出 assert im.shape[-1] == 1 or im.shape[-1] == 3 |
@qingqing01
|
在PR #7786 中修复了~ |
@qingqing01 |
@yeyupiaoling 提醒下,PR刚merge,编译之前请注意下~ |
@qingqing01 感谢提醒,我是今天早上clone的,应该是最新的了。 |
当我把
img = myimages.load_image(img, is_color=False)
中的参数is_color
设置False
时,就会报错,报错如下:The text was updated successfully, but these errors were encountered: