提交 3a738b74 编写于 作者: S SunAhong1993

fix the version of protobuf

上级 18ccff05
...@@ -129,9 +129,12 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto): ...@@ -129,9 +129,12 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto):
from x2paddle.op_mapper.caffe_op_mapper import CaffeOpMapper from x2paddle.op_mapper.caffe_op_mapper import CaffeOpMapper
from x2paddle.optimizer.caffe_optimizer import CaffeOptimizer from x2paddle.optimizer.caffe_optimizer import CaffeOptimizer
import google.protobuf as gpb import google.protobuf as gpb
ver_str = gpb.__version__.replace('.', '') ver_part = gpb.__version__.split('.')
ver_int = int(ver_str[0:2]) version_satisfy = False
assert ver_int >= 36, 'The version of protobuf must be larger than 3.6.0!' if (int(ver_part[0]) == 3 and int(ver_part[1]) >= 6) \
or (int(ver_part[0]) > 3):
version_satisfy = True
assert version_satisfy, 'The version of protobuf must be larger than 3.6.0!'
print("Now translating model from caffe to paddle.") print("Now translating model from caffe to paddle.")
model = CaffeDecoder(proto, weight, caffe_proto) model = CaffeDecoder(proto, weight, caffe_proto)
mapper = CaffeOpMapper(model) mapper = CaffeOpMapper(model)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册