diff --git a/x2paddle/convert.py b/x2paddle/convert.py index a5aab534ec0916ce236f069bbb9e8f6d2695da80..f9b7384a9cb978d0e321d9a8c6655c1ae40b1e17 100644 --- a/x2paddle/convert.py +++ b/x2paddle/convert.py @@ -110,6 +110,17 @@ def onnx2paddle(model_path, save_dir): except: print("onnx is not installed, use \"pip install onnx==1.5.0\".") return + try: + import torch + version = torch.__version__ + if '1.1.0' not in version: + print("your model have dynamic graph, torch==1.1.0 is required") + return + except: + print( + "your model have dynamic graph, we use caff2 to inference graph, please use \"pip install torch==1.1.0\"." + ) + return print("Now translating model from onnx to paddle.") from x2paddle.decoder.onnx_decoder import ONNXDecoder