提交 8e130a93 编写于 作者: S SunAhong1993

check protobuf

上级 bb950ab8
...@@ -122,14 +122,8 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto): ...@@ -122,14 +122,8 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto):
from x2paddle.decoder.caffe_decoder import CaffeDecoder from x2paddle.decoder.caffe_decoder import CaffeDecoder
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
s = sys.version import google.protobuf as gpb
if s.startswith('2'): ver_str = gpb.__version__.replace('.', '')
import commands
pb_version = commands.getstatusoutput('pip list | grep protobuf')[1]
else:
import subprocess
pb_version = subprocess.getstatusoutput('pip list | grep protobuf')[1]
ver_str = pb_version.replace(' ', '').split('protobuf')[-1].replace('.', '')
ver_int = int(ver_str) ver_int = int(ver_str)
assert ver_int >= 360, 'The version of protobuf must be larger than 3.6.0!' assert ver_int >= 360, '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.")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册