amd / RyzenAI-SW

MIT License
405 stars 65 forks source link

Large calibration images while quantizing #128

Closed waquey closed 1 week ago

waquey commented 1 month ago

Dear great authors,

I'd like to quantize large input size models such as 1x1024x1024x3.
However, when I try the method of RyzenAI_quant_tutorial/onnx_example/onnx_model_ptq, out of memory issues occurred. As documents illustrated, calibration needs around 100~1000 images. But one image takes ~3g. Is there any method to quantize models with large input resolution?

PS: If it is transformer-based, is there any recommended method to do before quantization?

Thanks

cyndwith commented 4 weeks ago

When dealing with large image sizes, memory errors can occur due to the high memory consumption required to load and process the images.

One options it to try and reduce the batch size to accommodate the images based on the available system memory.

cyndwith commented 1 week ago

close issue due to inactivity