HanyangZhong / FENet

MIT License
4 stars 0 forks source link

SwinTransformer export onnx #4

Open adherent-ls opened 3 weeks ago

adherent-ls commented 3 weeks ago

export command:

       paddle2onnx --model_dir /home/data/workspace/training_models/PaddleOCR/output/swin_db/paddle_model_static_onnx_temp_dir \
        --model_filename model.pdmodel \
        --params_filename model.pdiparams \
        --opset_version 11 \
        --save_file output.onnx

[ERROR] Cannot found attribute fp32_values in op: set_value image

paddle和paddle2onnx版本: paddle2onnx 1.2.1 paddlepaddle-gpu 2.5.2.post120

HanyangZhong commented 3 weeks ago

The error message here indicates that there is an issue with the PaddlePaddle model conversion to ONNX format. Specifically, it is unable to find the attribute fp32_values in the set_value operation. Here are some steps you can take to try to fix this issue:

  1. Check Paddle2ONNX Version: Ensure that you are using the latest version of Paddle2ONNX. The error might be due to a version incompatibility. As of now, you mentioned using paddle2onnx 1.2.1. Check if there's a newer version available and update if necessary.

    pip install --upgrade paddle2onnx
  2. Update PaddlePaddle: Ensure that PaddlePaddle itself is up-to-date. Sometimes, bugs in the framework can cause such issues, and they might be fixed in newer releases.

    pip install --upgrade paddlepaddle-gpu
  3. Model Compatibility: Verify that the model you are trying to convert is supported by the version of Paddle2ONNX you are using. There might be certain operations or attributes in newer models that are not supported by the converter.

  4. Check Model Files: Make sure that the model files (model.pdmodel and model.pdiparams) are correctly specified and not corrupted.

  5. Debugging Details: Increase the verbosity or debug level of Paddle2ONNX to get more details on where exactly it is failing.

  6. Custom Conversion Script: If the automatic conversion does not work, consider writing a custom conversion script. You can manually handle the conversion of specific operations or attributes that are causing issues.