Code Monkey home page Code Monkey logo

Comments (4)

veb-101 avatar veb-101 commented on July 19, 2024 1

The doc contains details about how to do QAT and PQT, but it doesn't mention the procedure to load the then-trained model for inference.

Specifically, I want to know how to load and use the quantized YOLO-NAS FP16 and INT8 models listed in the README documentation.

The following line loads the model in FP32 precision.

yolo_nas_s = super_gradients.training.models.get("yolo_nas_s", pretrained_weights="coco")

What are the next steps I need to perform to load and use the quantized version (FP16 and INT8) as mentioned in the docs?

Edit: Removed question about QSP and QCI blocks

from super-gradients.

dagshub avatar dagshub commented on July 19, 2024

Join the discussion on DagsHub!

from super-gradients.

NatanBagrov avatar NatanBagrov commented on July 19, 2024

Hello, @veb-101 , I refer you to this document. Let me know if this helps!

from super-gradients.

NatanBagrov avatar NatanBagrov commented on July 19, 2024

To load the model for inference you should compile it to TensorRT. The INT8 QAT model is convertible to an ONNX with Q/DQ layers which are then compiled into actual INT8 quantization.

You can follow the code of QATTrainer to see how the FP32 model is being quantized and calibrated, then exported to ONNX.

To get INT8 model, as I mentioned, you need to compile it to TensorRT, which can be achieved using trtexec. Here's a snippet:

/usr/src/tensorrt/bin/trtexec --onnx=$1.onnx --workspace=2048 --avgRuns=100 --duration=15 --int8 --fp16 --saveEngine=$1.engine

Read more about TensorRT in the NVIDIA's docs.

from super-gradients.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.