Skip to content

Upgrade mobilenet tensorrt 10 - #1707

Closed
makaveli10 wants to merge 1 commit into
wang-xinyu:masterfrom
makaveli10:vineet/upgrade-mobilenet-tensorrt-10
Closed

makaveli10 wants to merge 1 commit into
wang-xinyu:masterfrom
makaveli10:vineet/upgrade-mobilenet-tensorrt-10

Conversation

@makaveli10

@makaveli10 makaveli10 commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Upgrades Mobilenetv2 & MobileNetV3 (both Small and Large variants) implementation to support TensorRT 10.x API

C++ Implementations

  • Replaced deprecated APIs:
    • IBuilder::buildEngineWithConfig() -> IBuilder::buildSerializedNetwork()
    • ICudaEngine::deserialize() -> IRuntime::deserializeCudaEngine() with custom IStreamReaderV2
    • IExecutionContext::execute() -> IExecutionContext::enqueueV3()
  • Implemented MyStreamReaderV2 class for TensorRT 10 engine deserialization
  • Updated inference pipeline to use setTensorAddress() and modern execution API

Python Implementations

  • Replaced build_engine() -> build_serialized_network()
  • Updated to explicit batch mode with NetworkDefinitionCreationFlag.EXPLICIT_BATCH
  • Replaced deprecated add_fully_connected() with `add_matrix_multiply()
  • Updated buffer allocation to use TensorRT 10 tensor API (get_tensor_name(), set_tensor_address(), etc.)
  • Migrated to execute_async_v3() for inference

Other Improvements

  • Updated README files with correct script names and output file names
  • Added utils.h for image preprocessing pipeline

Output Sanity Check agains pytorchx:
mobilenetv2:

pytorchx: -2.4736e-01,  9.7207e-02, -4.6410e-01, -4.4953e-01, -2.9302e-01
tensorrtx: -0.249305, 0.0987378, -0.469779, -0.460538, -0.292541

mobilenetv3-small:

pytorchx: -3.4606e-03, -1.2621e-01,  2.3399e-01, -1.2450e-01,  2.7816e-01
tensorrtx: 0.0197003, -0.112725, 0.211143, -0.124036, 0.288239

mobilenetv3-large

pytorchx: -5.2233e-01,  7.0307e-01,  1.2416e+00,  6.9224e-01,  1.4927e+00
tensorrtx: -0.536705, 0.708078, 1.24243, 0.717128, 1.50676

@mpj1234

mpj1234 commented Feb 22, 2026

Copy link
Copy Markdown
Collaborator

TensorRT 10 support, please push to trt10 branch.

Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
@makaveli10
makaveli10 force-pushed the vineet/upgrade-mobilenet-tensorrt-10 branch from 7f28211 to 79d5c57 Compare February 23, 2026 05:13
@makaveli10 makaveli10 closed this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants