Bläddra i källkod

add x2paddle for paddle export to onnx

jiangjiajun 5 år sedan
förälder
incheckning
94a29f112d
1 ändrade filer med 4 tillägg och 0 borttagningar
  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':