tensorrtx builds each network layer by layer in C++, and the .wts file is the only bridge from the trained model
Implementation of popular deep learning networks with TensorRT network definition API
At a glance
- What is it?
- TensorRTx reimplements popular deep learning networks with the TensorRT network definition API instead of an ONNX or caffe parser. This piece covers the .wts workflow, the two build routes, the TensorRT version split, and the folders that exist.
- Who is it for?
- Use TensorRTx if you want to read, change and debug a network layer by layer on TensorRT, and you can accept writing and maintaining C++ per model. Skip it if you want a one-step converter from a trained file to an engine.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 100 days ago.
- What is it written in?
- Mainly C++, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- wang-xinyu/tensorrtx7,850 ★ · +15
| Repository | 2026-10-08 | 2026-11-25 |
|---|---|---|
| wang-xinyu/tensorrtx | 7.8k | 7.9k |
15 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Networks are written out layer by layer because the author skips every parser
TensorRTx implements popular deep learning networks with the TensorRT network definition API. Its README poses the obvious objection itself: why not use a parser, such as the ONNX parser, the UFF parser or the caffe parser, instead of complex APIs that build a network from scratch?
The stated answer has three parts. The approach is flexible: you can add or delete a layer or an input or output tensor, replace a layer, merge layers, and integrate preprocessing and postprocessing into the network. It is debuggable, because the whole network is constructed incrementally and middle layer results are easy to get. And it is educational, since you learn the network structure instead of treating everything as a black box.
The cost is plain. Every supported model is hand-written C++ in its own folder, from alexnet and densenet to yolov5 and swin-transformer. A model that has no folder here has no quick route in. The primary language is C++ and the license is MIT.
The .wts text file carries weights from PyTorch, MXNet or TensorFlow into C++
The workflow has four steps. First, get a trained model from pytorch, mxnet or tensorflow. Some pytorch models come from the author's pytorchx repository, and the remaining ones are from popular open-source repositories.
Second, export the weights to a plain text file in the .wts format. Its content format is described in tutorials/getting_started.md under the heading the-wts-content-format. Third, load the weights in TensorRT, define the network and build a TensorRT engine. Fourth, load the engine and run inference.
The design puts a text file between the training framework and the C++ code. That keeps the C++ free of any framework dependency, but it also means each model needs a matching export script. For lenet, the README points at the lenet folder in pytorchx for generating the .wts file. Models from other sources have their own export instructions in their subfolders.
Two build routes exist, and the top-level one is marked as unfinished
Each network can be built from the CMakeLists.txt in its own subfolder, or all together from the CMakeLists.txt at the top of the project. The first route is the dependable one:
## enter the subfolder
cd tensorrtx/xxx
## configure & build
cmake -S . -B build
make -C buildThe second route needs you to edit the top CMakeLists.txt and uncomment the projects you do not want to build or that your TensorRT version does not support. The example given is that you cannot build subprojects in ${TensorRT_8_Targets} if your TensorRT is 7.x. Then:
## enter the top of this project
cd tensorrtx
## configure & build
# you may use "Ninja" rather than "make" to significantly boost the build speed
cmake -G Ninja -S . -B build
ninja -C buildA WARNING follows: this part is still under development and most subprojects are not adapted yet. Before building, put xxx.wts on top of the folder.
Serialize with -s once, then deserialize with -d on every run
The executables take two modes. The first serializes the model to a plan file, an xxx.engine, and the second deserializes that plan file and runs inference:
# serialize model to plan file i.e. 'xxx.engine'
build/xxx -s
# deserialize plan file and run inference
build/xxx -dThe split exists because building an engine from the network definition is the slow step, while loading a saved plan is the part you repeat.
An engine file is tied to the TensorRT build that produced it so rebuild after upgrading TensorRT. The README adds two optional steps as comments: check that the output matches pytorchx/lenet, and customize the project. For more detail, each subfolder may contain its own README.md.
The default branch moved to TensorRT 10 on 24 June 2026, and older versions need care
The test environment line reads TensorRT 10.x+. The News section records the change: on 24 Jun 2026 the project switched to trt10 on the main branch as the default branch. A refactor on 15 Jan 2026 by zgjja changed multiple old CV models to support the TensorRT SDK through versions 7 to 10.
Two notes qualify this. For historical reasons, some models are limited to a specific TensorRT version, and the README tells you to check the model's README.md or code. And currently TensorRT 8.x has better compatibility, with most of the features supported.
Those two lines pull in different directions: the stated test environment is 10.x and above, while the compatibility note favors 8.x. If your deployment is pinned to a specific JetPack or driver, pick the TensorRT version first, then open the folder for your model and read its notes before cloning anything else. The tutorials folder includes an install guide, a migration guide and a page on checking whether your GPU supports FP16 and INT8.
The News list shows contributors adding YOLO and transformer models through 2026
Additions come mostly from outside contributors, each credited by GitHub name. In 2026: mpj1234 added Qwen3-0.6B on 11 Jul, lindsayshuo added PP-OCRv5, PP-Structure and PP-FormulaNet on 19 May, zgjja added Vision Transformer on 3 Mar, fazligorkembal added Yolo26-Det, Yolo26-Obb and Yolo26-Cls on 2 Feb, and ydk61 added YOLOv13 on 8 Jan.
Earlier entries include YOLO12 on 2 May 2025, YOLO11-obb on 11 Apr 2025, YOLOv8-obb on 22 Oct 2024, YOLO11 on 11 Oct 2024, GhostNet V1 and V2 on 9 Oct 2024 and real-esrgan-general-x4v3 on 21 Aug 2024.
Two entries by pranavm-nvidia on 12 Apr and 10 May 2025 are written in Tripy, a Python programming model linked from the NVIDIA TensorRT-Incubator repository: a Lenet example and YOLO11. The folder listing also includes qwen3, vit, detr, unet, hrnet and crnn, so the range runs from small classifiers to OCR and a language model.
The repository is not archived. Its last push was on 2026-08-18, and it has no GitHub releases, so there is no tag to pin.
The tutorials cover multi-GPU, Windows and Triton, with one page only in Chinese
The README links a set of tutorials beyond the build steps. They cover how to contribute, installing the dependencies, a getting started guide that uses lenet5, a FAQ and a migration guide. Further pages explain multi-GPU processing with YOLOv4 as the example, checking FP16 and INT8 support, and compiling and running on Windows.
For serving, the README points to an outside project, isarsoft's yolov4-triton-tensorrt, for deploying YOLOv4 with Triton Inference Server. That is not part of this repository.
One tutorial, taking hrnet from pytorch to TensorRT step by step, is marked as Chinese.
The docker folder exists at the top level and a docker image refactor by zgjja is listed on 18 Oct 2024.
Editorial conclusion
Use TensorRTx if you want to read, change and debug a network layer by layer on TensorRT, and you can accept writing and maintaining C++ per model. Skip it if you want a one-step converter from a trained file to an engine. Before building, check the TensorRT version note in the subfolder README for your model, because some models are limited to specific versions.
Frequently asked questions
Is ONNX faster than TensorRT?
The README's stated reasons are not about speed: the project avoids the ONNX, UFF and caffe parsers on purpose and builds networks with the TensorRT network definition API for flexibility and debugging.
What is TensorRT versus TensorFlow in TensorRTx?
TensorFlow is a source of trained models here, alongside pytorch and mxnet. The weights are exported to a .wts file, then TensorRT defines the network and builds an engine.
Is TensorRT a part of NVIDIA?
The README links NVIDIA's TensorRT-Incubator repository for its Tripy examples, which use a new TensorRT Python programming model. It states no ownership details beyond that.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/wang-xinyu-tensorrtx)Star history chart for your README
[](https://hysenlabs.com/projects/wang-xinyu-tensorrtx)Was this useful?