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

Merge pull request #65 from jiangjiajun/develop

check requirements
......@@ -52,6 +52,19 @@ def arg_parser():
def tf2paddle(model_path, save_dir):
# check tensorflow installation and version
try:
import tensorflow as tf
version = tf.__version__
if version >= '2.0.0' or version < '1.0.0':
print(
"1.0.0<=tensorflow<2.0.0 is required, and v1.14.0 is recommended"
)
return
except:
print("Tensorflow not installed, use \"pip install tensorflow\"")
return
from x2paddle.decoder.tf_decoder import TFDecoder
from x2paddle.op_mapper.tf_op_mapper import TFOpMapper
......@@ -75,6 +88,16 @@ def main():
parser = arg_parser()
args = parser.parse_args()
try:
import paddle.fluid as fluid
import paddle
v0, v1, v2 = paddle.__version__.split('.')
if int(v0) != 1 or int(v1) < 5:
print("paddlepaddle>=1.5.0 is required")
return
except:
print("paddlepaddle not installed, use \"pip install paddlepaddle\"")
assert args.framework is not None, "--from is not defined(tensorflow/caffe)"
assert args.save_dir is not None, "--save_dir is not defined"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册