我无法从 S3 存储桶读取图像。我可以像这样在本地读取图像。
def load_image(path):
image = cv2.imread(path)
image = cv2.resize(image, (224, 224))
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
return image
for image_path in os.listdir(path):
image = load_image(path + "/" + image_path)
X.append(image)
但我不知道为什么 S3 说错误
TypeError: Can't convert object of type 'list' to 'str' for 'filename'