首先,需要确认quantize_qat(量化感知训练量化)是否确实是onnxruntime.quantization模块的一部分。由于onnxruntime的库可能会更新并移除或重命名某些功能,因此建议直接查阅ONNX Runtime的官方文档或GitHub仓库的更新日志以确认这一点。 如果文档中明确提到了quantize_qat,并且说明它位于onnxruntime.quantization下,那么我们...
ImportError: cannot import name 'quantize_qat' from 'onnxruntime.quantization' in I had the same error before. After checking the source code, I figured out thatquantize_qatis not in recent versions. However you can see it in an earlier version like v1.5.1 Seehttps://github.com/microsoft...
{learningrate:g}") # You must remove hooks during onnx export or torch.save for rm in remove_handle: rm.remove() if per_epoch_callback: if per_epoch_callback(model, iepoch, learningrate): break def export_onnx(model, input, file, *args, **kwargs): quant_nn.TensorQuantizer.use_...