按照教程:
使用这些文件:
https://github.com/fchollet/deep-learning-models
根据我的执行方式,我得到 2 个单独的错误:
在 PyCharm 中运行:
Using TensorFlow backend.
usage: test_imagenet.py [-h] -i IMAGE
test_imagenet.py: error: the following arguments are required: -i/--image
在 cmd 行中运行:
C:\Users\AppData\Local\Programs\Python\Python35\Scripts>python deep-learning-models/test_imagenet.py --image deep-learning-models/images/dog.jpg
Traceback (most recent call last):
File "deep-learning-models/test_imagenet.py", line 2, in <module>
from keras.preprocessing import image as image_utils
ImportError: No module named keras.preprocessing
我该如何解决?
原文由 DJ Howarth 发布,翻译遵循 CC BY-SA 4.0 许可协议
如果您在运行上述脚本之外解决此问题是最好的…这是您可以在命令行环境中尝试的方法以确保它在您的脚本之外工作:
确保安装了最新版本的 keras。如果您无法正常工作,则可能是上述脚本无法找到 keras 包的环境问题。但是,如果以上不起作用或部分起作用,您需要先将其删除以再次安装 keras。