未验证 提交 7b4a466e 编写于 作者: S SunAhong1993 提交者: GitHub

Update resolver.py

上级 c9f10e2b
...@@ -6,14 +6,20 @@ SHARED_CAFFE_RESOLVER = None ...@@ -6,14 +6,20 @@ SHARED_CAFFE_RESOLVER = None
def import_caffepb(): def import_caffepb():
p = os.path.realpath(__file__) p = os.path.realpath(__file__)
p = os.path.dirname(p) p = os.path.dirname(p)
p = os.path.join(p, '../../proto') p = os.path.join(p, '../../proto')
sys.path.insert(0, p) sys.path.insert(0, p)
pb_version = subprocess.getstatusoutput('protoc --version')[1] s = sys.version
if s.startswith('2'):
import commands
pb_version = commands.getstatusoutput('protoc --version')[1]
else:
import subprocess
pb_version = subprocess.getstatusoutput('protoc --version')[1]
ver_str = pb_version.split(' ')[-1].replace('.', '') ver_str = pb_version.split(' ')[-1].replace('.', '')
ver_int = int(ver_str) ver_int = int(ver_str)
assert vaer_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!'
import caffe_pb2 import caffe_pb2
return caffe_pb2 return caffe_pb2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册