diff --git a/x2paddle/decoder/onnx_decoder.py b/x2paddle/decoder/onnx_decoder.py index 76167c19355792759be5675e6b650157c90df9d2..bb271a961c8dc2b46e5923491bad8b885bd8d8cf 100644 --- a/x2paddle/decoder/onnx_decoder.py +++ b/x2paddle/decoder/onnx_decoder.py @@ -461,6 +461,15 @@ class ONNXDecoder(object): """ get dynamic shape from caffe2.backend """ + try: + import torch + version = torch.__version__ + if '1.1.0' not in version: + print("torch==1.1.0 is required") + return + except: + print("onnx is not installed, use \"pip install torch==1.1.0\".") + return from caffe2.python.onnx.backend import prepare shape = input_shapes[0] np_images = np.random.rand(shape[0], shape[1], shape[2],