dnn cleanup: On-fly-quantization removal#24980
Conversation
|
Should we keep
|
|
Ubuntu2004-x64-CUDA / BuildAndTest: I took a loot at the model and it has nothing to do with quantization, so this should not be related to the changes in this PR. |
|
@fengyuentau, since the error is still very low, probably it makes sense just slightly increase the tolerance threshold, e.g. from 0.0007 to 0.001 |
Yes, sure. I want to find out whether it is sporadic and do it in antoher PR. |
|
Related: #24993 |
| CV_WRAP void getInputDetails(CV_OUT std::vector<float>& scales, CV_OUT std::vector<int>& zeropoints) const; | ||
|
|
||
| /** @brief Returns output scale and zeropoint for a quantized Net. | ||
| * @param scales output parameter for returning output scales. | ||
| * @param zeropoints output parameter for returning output zeropoints. | ||
| */ | ||
| CV_WRAP void getOutputDetails(CV_OUT std::vector<float>& scales, CV_OUT std::vector<int>& zeropoints) const; |
There was a problem hiding this comment.
I suppose that getInputDetails and getOutputDetails should be presumed. We support pre-quantized networks and the mentioned API is not related to on-fly quantization.
There was a problem hiding this comment.
They are only used in test_int8_layers.cpp which quantizes nets on the fly (thus you need to quantize the inputs manually with the inputDetails). I don't think they are useful anymore given the fact that we are removing on-fly quantization.
|
@fengyuentau, thank you! We discussed it briefly with @asmorkalov. Indeed, the functionality shall be removed and the tests should be commented off. It's recommended to use |
|
I think |
I used |
On-fly-quantization is first introduced via #20228. We decided to remove it but keep int8 layers implementation because on-fly-quantization is less practical given the fact that there has been so many dedicated tools for model quantization.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.