cancel
Showing results for 
Search instead for 
Did you mean: 

Errors Analyzing Models in X-Cube-AI Tool

casperbroch
Associate

Hello everyone,

I am encountering issues while using the X-Cube-AI tool to analyze two models that I recently resized and reduced. Despite thorough testing and troubleshooting, I cannot resolve the errors, and I hope someone here might provide insight.

Issue Details:

  1. Model Behavior in Python:

    • Both models run perfectly in Python.
    • They work well when tested as .onnx models using other tools.
  2. Troubleshooting Steps Taken:

    • Analyzed the .onnx models manually using Netron.app — no issues were identified.
    • Attempted analysis using both my local IDE and the ST Developer Cloud Tool — both returned the same errors.
    • Enabled maximum verbosity (level 3) during analysis, but the error messages provided no actionable information.

Error Messages:

  • anchornet.onnx:

     
    INTERNAL ERROR: 'NoneType' object is not subscriptable
  • pointnet.onnx:

     
    INTERNAL ERROR: Mismatch in input shape of gemm: (BATCH: 1, CH: 512, H: 3) x (BATCH: 1, CH: 3, H: 3)

While the second error provides slightly more detail, it remains unclear where or how this mismatch occurs in the model.

Additional Notes:

  • I have access to the original Python code and Torch models from which the .onnx files were exported. I can modify the models if necessary to resolve compatibility issues.

I feel like I’ve tried everything I can think of. Is there a chance someone could help me identify what’s going wrong or suggest next steps to debug this further?

Thanks in advance for any help or guidance!

1 REPLY 1
Julian E.
ST Employee

Hello @casperbroch,

 

I have opened internal ticket to the team in charge of this. I wait for guidance.

They are probably bugs on our side. I will keep you updated.

 

For the pointnet.onnx, X-cube-AI does not like undefined channel size, which may cause the error. In your onnx, your input size is [nb_value_grasp,35,512]. Even when fixing the nb_value_grasps to 1, there are still layer with unknown size:

JulianE_1-1736957622767.png

The code used to obtain the onnx in the screenshot:

import onnx
import onnxruntime
from onnxruntime.tools.onnx_model_utils import fix_output_shapes, make_dim_param_fixed
 
from onnx.tools import update_model_dims

import onnx
import onnxruntime
from onnxruntime.tools.onnx_model_utils import fix_output_shapes, make_dim_param_fixed
 
from onnx.tools import update_model_dims
 
model = onnx.load("pointnet.onnx")
make_dim_param_fixed(model.graph, param_name="n_valid_grasps", value=1)
fix_output_shapes(model)
# update_model_dims.update_inputs_outputs_dims(model, {"pointcloud": [1, 35, 512]}, {"pointnet_features": [1, "Reshapepointnet_features_dim_1"]})
 
model = onnx.shape_inference.infer_shapes(model)
onnx.save(model, "fixed_pointnet.onnx")
 

 

it seems that it is the constantOfShape that is introducing the unknown shape. If you manage to solve it, it may work with cubeAI. Another solution is to modify the model to create the mask (if I a not mistaken, it is what the middle branch of the graph is doing) in the init instead of the foward (if your are using pytorch).

 

In anyways, I also asked for this model, so I will tell you if we have a solution.

 

Have a good day.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.