Quellcode durchsuchen

Merge pull request #562 from Channingss/onnx

set the version of paddle2onnx to 0.4
Jason vor 4 Jahren
Ursprung
Commit
2ae621f735
2 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
  1. 7 1
      paddlex/converter.py
  2. 1 1
      requirements.txt

+ 7 - 1
paddlex/converter.py

@@ -267,8 +267,14 @@ def export_onnx_model(model, save_file, opset_version=10):
         import paddle2onnx 
     except:
         logging.error(
-            "You need to install paddle2onnx first, pip install paddle2onnx")
+            "You need to install paddle2onnx first, pip install paddle2onnx==0.4")
+
     import paddle2onnx as p2o
+
+    if p2o.__version__ != '0.4':
+        logging.error(
+            "You need install paddle2onnx==0.4, but the version of paddle2onnx is {}".format(p2o.__version__))
+
     if opset_version == 10 and model.__class__.__name__ == "YOLOv3":
         logging.warning(
             "Export for openVINO by default, the output of multiclass_nms exported to onnx will contains background. If you need onnx completely consistent with paddle, please use paddle2onnx to export"

+ 1 - 1
requirements.txt

@@ -6,7 +6,7 @@ pycocotools
 visualdl >= 2.0.0b
 paddleslim == 1.1.1
 shapely
-paddle2onnx
+paddle2onnx==0.4
 paddlepaddle-gpu
 opencv-python
 psutil