ONNX import failure

Does anyone know how to get through this SnapML issue when importing ONNX files?

Resource import for .onnx failed. The ONNX model's constant layer tensor dimensions size must be 1, 2, 3 or 4


  • Bakari Mustafa
    Bakari Mustafa Posts: 174 🔥🔥🔥

    SnapML only supports constant layer tensor dimensions of size 1, 2, 3, or 4. If your model contains a constant layer tensor with dimensions outside of this range, it will fail to import.

    To resolve this issue, you can try the following steps:
    1. Open your ONNX model in a third-party tool such as Netron to inspect its architecture and identify any constant layer tensors with dimensions outside of the supported range.
    2. Modify your model to ensure that all constant layer tensors have dimensions of size 1, 2, 3 or 4. This may involve changing the architecture of your model or retraining it using different hyperparameters.
    3. Export your modified model as an ONNX file and try importing it into Lens Studio again.