diff --git a/caffe2fluid/README.md b/caffe2fluid/README.md index b2e9990eff5d250c0b3ed21ad5ce4dbace365bef..8d3c92212992239bcce5cba7690a0f72ecb9b9fa 100644 --- a/caffe2fluid/README.md +++ b/caffe2fluid/README.md @@ -69,8 +69,22 @@ bash tools/diff.sh alexnet ../../alexnet.prototxt \ 2. 添加`import mylayer`至`kaffe/custom_layers/__init__.py` 3. 准备你的pycaffe作为你的定制版本(与以前的env准备相同) -> 选择一:1. 编译你自己的caffe.proto来代替proto/caffe.proto - 2. 修改./kaffe/caffe/resolver.py +> 选择一: +1. 编译你自己的caffe.proto来代替proto/caffe.proto +2. 修改./kaffe/caffe/resolver.py +```python +try: + # Try to import PyCaffe first + import caffe + self.caffe = caffe +except ImportError: + # Fall back to the protobuf implementation + self.caffepb = import_caffepb() + show_fallback_warning() +# 将上述代码替换为 +self.caffepb = import_caffepb() +show_fallback_warning() +``` > 选择二:更换你的pycaffe到特定的版本