我将在一个函数中构建一个双三次图像,然后我想在API模型中的一个层中使用它,我看到了这个错误,我该如何解决它?谢谢你!!
def model_bicubic(image):
image = Image.open(image, mode = 'r')
width, height = image.size
image_bicubic = image.resize((width*2, height*2), Image.BICUBIC)
return image_bicubic发布于 2020-09-03 22:29:55
您可以通过以下方式进行尝试:
def load_image(img_path):
img = tf.io.read_file(img_path)
img = tf.io.decode_jpeg(img, channels = 3)
img = tf.image.resize(img, size = (width, height), method = 'bicubic')
img = img / 255.0
return img对我很管用。
https://stackoverflow.com/questions/60680942
复制相似问题