Explorar o código

add x2paddle for paddle export to onnx

jiangjiajun %!s(int64=5) %!d(string=hai) anos
pai
achega
94a29f112d
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      paddlex/convertor.py

+ 4 - 0
paddlex/convertor.py

@@ -30,6 +30,10 @@ def export_onnx(model_dir, save_dir, fixed_input_shape):
 
 
 def export_onnx_model(model, save_dir):
+    if model.model_type == "detector" or model.__class__.__name__ == "FastSCNN":
+        logging.error(
+            "Only image classifier models and semantic segmentation models(except FastSCNN) are supported to export to ONNX"
+        )
     try:
         import x2paddle
         if x2paddle.__version__ < '0.7.4':