Skip to content

Error during conversion of plnet1 ONNX to TensorRT engine – ForeignNode (/Cast_1.../Gather_69) implementation not found #203

Open
@SongSiWoon

Description

@SongSiWoon

Hello,

I'm encountering an error while converting the plnet1 ONNX model to a TensorRT engine on my Jetson Orin Nano (JetPack 6.2) environment using Docker. The Docker container is based on the image nvcr.io/nvidia/l4t-tensorrt:r8.6.2-devel (CUDA 12.2, TensorRT 8.6.2). The issue does not occur when running the model normally; the error shows up only when I attempt to build the engine separately with the plnet1 ONNX model.

I used the following command to build the engine:

/usr/src/tensorrt/bin/trtexec \
  --onnx=/workspace/src/AirSLAM/output/plnet_s1.onnx \
  --saveEngine=/workspace/src/AirSLAM/output/plnet_s1.engine \
  --explicitBatch \
  --minShapes=juncs_pred:1x2,lines_pred:1x4,idx_lines_for_junctions:1x2,inverse:1x1,iskeep_index:1x1,loi_features:1x16x16x16,loi_features_thin:1x4x16x16,loi_features_aux:1x4x16x16 \
  --optShapes=juncs_pred:250x2,lines_pred:20000x4,idx_lines_for_junctions:20000x2,inverse:20000x1,iskeep_index:20000x1,loi_features:1x128x128x128,loi_features_thin:1x4x128x128,loi_features_aux:1x4x128x128 \
  --maxShapes=juncs_pred:500x2,lines_pred:50000x4,idx_lines_for_junctions:50000x2,inverse:50000x1,iskeep_index:50000x1,loi_features:1x512x512x512,loi_features_thin:1x4x512x512,loi_features_aux:1x4x512x512 \
  --fp16

During the engine build process, I observed the following warnings and errors:

Warnings:

  • The --explicitBatch flag is deprecated and has no effect.

  • A warning indicating that the ONNX model was generated with INT64 weights, with a message like “Your ONNX model has been generated with INT64 weights… Attempting to cast down to INT32,” and that some values have been clamped.

Critical Error:

value.h:682: DCHECK(new_vv.cast(myelinTypeUint64)) failed.
...
[E] Error[10]: Could not find any implementation for node {ForeignNode[/Cast_1.../Gather_69]}.
[E] Error[10]: [optimizer.cpp::computeCosts::3869] Error Code 10: Internal Error (Could not find any implementation for node {ForeignNode[/Cast_1.../Gather_69]}).
[E] Engine could not be created from network
[E] Building engine failed

My Questions:

  1. Root Cause:
  • Is the error caused by the ONNX model being generated with INT64 weights that TensorRT does not natively support (thus automatically casting them to INT32), leading to potential issues during the conversion?

  • Or does this error indicate that certain operations in the ONNX model (such as those involving Cast or Gather) are not currently implemented in TensorRT 8.6.2?

  1. Potential Solutions:
  • Should the ONNX export process be modified to use supported types (e.g., using INT32 instead of INT64) to avoid these issues?

  • Would a custom plugin implementation or modifications to the model be required to handle the problematic operations?

  • Are there any known workarounds or updates to TensorRT that address this error?

Any insights or suggestions for resolving this issue would be greatly appreciated.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions