调用paddle.image.load_image接口时报错
Created by: yeyupiaoling
当我把img = myimages.load_image(img, is_color=False)
中的参数is_color
设置False
时,就会报错,报错如下:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/paddle/v2/reader/decorator.py", line 274, in handle_worker
r = mapper(sample)
File "/media/wang/软件/ubuntu/paddlepaddle/pycharm/PycharmProjects/LearnPaddle/note5/code/MyReader.py", line 17, in train_mapper
img = myimages.simple_transform(img, 32, self.imageSize, True, is_color=False)
File "/media/wang/软件/ubuntu/paddlepaddle/pycharm/PycharmProjects/LearnPaddle/note5/code/Myimage.py", line 320, in simple_transform
im = resize_short(im, resize_size)
File "/media/wang/软件/ubuntu/paddlepaddle/pycharm/PycharmProjects/LearnPaddle/note5/code/Myimage.py", line 179, in resize_short
assert im.shape[-1] == 1 or im.shape[-1] == 3
AssertionError