Python 模块 caffe.io 不起作用



我用的是Ubuntu 16.04,安装了Python 2.7和3.5。我已经从存储库中获得了Caffe并成功编译,所有测试都通过了。

当我在终端中工作时,我可以导入caffe模块,它有"io":

>>> import caffe
>>> caffe.io
<module 'caffe.io' from 'caffe/io.pyc'>

但是当我使用PyCharm时,"io"是缺席的:

    model = caffe.io.caffe_pb2.NetParameter()
AttributeError: 'module' object has no attribute 'io'

我要运行的代码示例在这里https://github.com/google/deepdream/blob/master/dream.ipynb

原因是本地caffe.py文件。感谢@ martinn -pieters的评论

最新更新