model.zero_grad() ?
Closed this issue · 2 comments
jeannotes commented
in
MQBench/application/yolov5_example/train.py
Line 377 in a57f16a
if opt.quantize:
if calibration_flag:
if i >= 50:
calibration_flag = False
model.zero_grad()
enable_quantization(model)
print('close calibration')
else:
print('calibration iter{}'.format(i))
continue
I am wondering why there is " model.zero_grad() ", what is the purpose?
Tracin commented
Calibration stage only for initialize the range (min / max) not for backward, so we can zero_grad().
github-actions commented
This issue has not received any updates in 120 days. Please reply to this issue if this still unresolved!