提交 bb950ab8 编写于 作者: S SunAhong1993

check protobuf

上级 d2eed101
......@@ -125,11 +125,11 @@ def caffe2paddle(proto, weight, save_dir, caffe_proto):
s = sys.version
if s.startswith('2'):
import commands
pb_version = commands.getstatusoutput('protoc --version')[1]
pb_version = commands.getstatusoutput('pip list | grep protobuf')[1]
else:
import subprocess
pb_version = subprocess.getstatusoutput('protoc --version')[1]
ver_str = pb_version.split(' ')[-1].replace('.', '')
pb_version = subprocess.getstatusoutput('pip list | grep protobuf')[1]
ver_str = pb_version.replace(' ', '').split('protobuf')[-1].replace('.', '')
ver_int = int(ver_str)
assert ver_int >= 360, 'The version of protobuf must be larger than 3.6.0!'
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.
先完成此消息的编辑!
想要评论请 注册