python-3.x - 模型可以预测新图像
问题描述
ValueError Traceback (last last call last) in () ----> 1 prediction = model.predict(image_resized.reshape(1,50,50,3)) 2 print('Prediction Score:\n',prediction[0 ]) ValueError:无法将大小为 2352 的数组重塑为形状 (1,50,50,3)
解决方案
只需查看您发布的内容,您应该替换image_resized.reshape(1,50,50,3)
为image_resized.reshape(1,28,28,3)
推荐阅读
- php - 实现 AJAX 搜索表后,重写 jQuery 脚本以使用动态链接链接表行
- python - 如何使用 Putty 在 Python 中设置 Cron 作业(操作系统为 Linaro)
- typescript - 设置 TypeScript 编译器的基本/工作目录
- java - 在 HQL 中查找日期之间的实体
- angular - 在 AngularFirestoreCollection 中转换 CollectionReference
还是可观察的? - python - Python - 将 For Loop 编写为文件作为生成器而不是 str/dict
- vba - 将全名从批处理文件传递到 vbs 文件,然后用它运行一个 word 宏
- python-3.x - QtDesigner5.11.0、python3.5和pyside2之间的兼容性问题?
- python - 为什么即使在 Python 中的新请求中,变量也会保留在内存中?
- batch-file - .bat 文件中的 NEQ "NOPROMPT" 有什么作用?