浏览代码

add x2paddle for paddle export to onnx

jiangjiajun 5 年之前
父节点
当前提交
94a29f112d
共有 1 个文件被更改,包括 4 次插入0 次删除
  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':