image = cv2.imread(path + file) image = cv2.resize(image, (48, 48), interpolation=cv2.INTER_CUBIC) # image = image.astype('float32') # transformer.set_raw_scale('data', 255) # 缩放到[0,255]之间 # transformer.set_channel_swap('data', (2, 1, 0)) # 交换通道,将图片由RGB变为BGR(caffe中图片是BGR格式,而原始格式是RGB,所以要转化) image /=255解决方法:加上这句,就可以除以255了
image = image.astype('float32')
本文介绍了在编程过程中遇到'No loop matching the specified signature and casting'错误的原因及解决方案,详细解析了错误背后的类型匹配问题,并提供了解决此类问题的具体步骤和代码示例。
1095

被折叠的 条评论
为什么被折叠?



