MLP is the most basic net in this tensorrtx project for starters. You can learn the basic procedures of building TensorRT app from the provided APIs. The process of building a TensorRT engine explained in the chart below.
This demo creates a single-layer MLP with TensorRT >= 7.2.x version support.
logging.h : A logger file for using NVIDIA TensorRT API (mostly same for all models)
mlp.wts : Converted weight file, can be generated from pytorchx/mlp, for mlp, it looks like:
2
linear.weight 1 3fff7e32
linear.bias 1 3c138a5a(you can create mlp.wts and copy this content into it directly)
see HERE
-
Generate mlp.wts (from
pytorchxor create on your own) -
Put mlp.wts into tensorrtx/mlp (if using the generated weights)
-
Run
cd tensorrtx/mlp python mlp.py -s # serialize model to plan file, i.e. 'mlp.engine' python mlp.py -d # deserialize plan file and run inference
