PaddlePaddle / PaddlePaddle/FastDeploy

量化时loss为NaN

Open
#2,052 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.7k
Forks
756
Avg merge
19h 28m
Merged PRs (30d)
4

Description

环境

  • 【FastDeploy版本】:fastdeploy-tools 0.0.1 paddlepaddle-gpu2.4.2 paddleslim2.4.0
  • 【编译命令】如果您是自行编译的FastDeploy,请说明您的编译方式(参数命令)
  • 【系统平台】: Linux x64(Ubuntu 20.04)
  • 【硬件】: Nvidia GPU 4090、3090Ti, CUDA 11.2 CUDNN 8.2.1
  • 【编译语言】: C++ / Python3.8

问题

在进行模型QAT量化时,经常出现如下问题,前几轮还算正常,但后面的loss就变成了nan,最后导致量化失败。

image

使用的命令:fastdeploy compress --config_path=./configs/detection/yolov7_quant.yaml --method='QAT' --save_dir='./yolov7_qat_model/'
配置文件cofig:
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the QAT run with configs/detection/yolov7_quant.yaml using the reported fastdeploy compress command and the listed environment. Inspect the configuration and training output around the point where loss becomes NaN. Done means the QAT run completes without NaN loss and produces the quantized model.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.