Set qconfig = None but QDQ still appears

username: MrOCW
cooked: <p>Hi, I’ve set the qconfig = None for the Detect layer of YOLOv5<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/9/c9b66eb5b83f263ccaac33f160f3fc64ac8e4e12.png" data-download-href="https://discuss.pytorch.org/uploads/default/c9b66eb5b83f263ccaac33f160f3fc64ac8e4e12" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/c/9/c9b66eb5b83f263ccaac33f160f3fc64ac8e4e12_2_354x500.png" alt="image" data-base62-sha1="sMqPxwZnBK0RHIomW3eLvLhQaWe" width="354" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/c/9/c9b66eb5b83f263ccaac33f160f3fc64ac8e4e12_2_354x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/c/9/c9b66eb5b83f263ccaac33f160f3fc64ac8e4e12_2_531x750.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/c/9/c9b66eb5b83f263ccaac33f160f3fc64ac8e4e12.png 2x" data-dominant-color="3A1830"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">602×850 72.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>However, when exported to ONNX, the weights still appears to be quantized?<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/8/1850d54d558940b33f1b424a3c5406271e1d9453.png" data-download-href="https://discuss.pytorch.org/uploads/default/1850d54d558940b33f1b424a3c5406271e1d9453" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/1/8/1850d54d558940b33f1b424a3c5406271e1d9453_2_690x208.png" alt="image" data-base62-sha1="3t6DUb9xgKIvDG88nxHNZFSCjxV" width="690" height="208" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/1/8/1850d54d558940b33f1b424a3c5406271e1d9453_2_690x208.png, https://discuss.pytorch.org/uploads/default/optimized/3X/1/8/1850d54d558940b33f1b424a3c5406271e1d9453_2_1035x312.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/1/8/1850d54d558940b33f1b424a3c5406271e1d9453.png 2x" data-dominant-color="EEEEEE"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1168×353 48 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>How do i have the Detect layer be fully non-quantized?</p>
<p>I am doing this as the post processed QAT model does not have weights attached to the Conv2Ds of the Detect layer, which I am guessing is causing further exporting issues? The ‘+’ sign is missing form the weights<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/f/fff70456acac42a63efa7706cca788272cf3375a.png" data-download-href="https://discuss.pytorch.org/uploads/default/fff70456acac42a63efa7706cca788272cf3375a" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/f/fff70456acac42a63efa7706cca788272cf3375a_2_690x447.png" alt="image" data-base62-sha1="AwmZ9sYf9MqoJqPXifUNPF91ePw" width="690" height="447" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/f/fff70456acac42a63efa7706cca788272cf3375a_2_690x447.png, https://discuss.pytorch.org/uploads/default/original/3X/f/f/fff70456acac42a63efa7706cca788272cf3375a.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/f/f/fff70456acac42a63efa7706cca788272cf3375a.png 2x" data-dominant-color="EFEFEF"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">975×632 52 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Thanks!</p>

username: HDCharles
cooked: <p>can you provide more context? how are you quantizing the model exactly, its hard to answer about what’s going wrong without understanding what you are specifically doing.</p>

username: MrOCW
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/f/9fd6257ef2c5874ca1a2fb6f3b2be6db8c211079.png" data-download-href="https://discuss.pytorch.org/uploads/default/9fd6257ef2c5874ca1a2fb6f3b2be6db8c211079" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/9/f/9fd6257ef2c5874ca1a2fb6f3b2be6db8c211079_2_690x198.png" alt="image" data-base62-sha1="mNYIUX9MLw9HsR0An3oRpaJ3NPz" width="690" height="198" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/9/f/9fd6257ef2c5874ca1a2fb6f3b2be6db8c211079_2_690x198.png, https://discuss.pytorch.org/uploads/default/original/3X/9/f/9fd6257ef2c5874ca1a2fb6f3b2be6db8c211079.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/9/f/9fd6257ef2c5874ca1a2fb6f3b2be6db8c211079.png 2x" data-dominant-color="F6F6F7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">933×269 40.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<ol>
<li>i added QDQs in the Conv class</li>
<li>fuse the model [conv bn relu]</li>
<li></li>
</ol>
<p><img src="https://discuss.pytorch.org/uploads/default/original/3X/8/3/838d4cb0c28a5c6bc87b53d01d6ce6030590f9b9.png" alt="image" data-base62-sha1="iLLhsl36HxDZz7yHZqJyeskrWTn" width="587" height="135"></p>

username: HDCharles
cooked: <p>You haven’t quantized the model in what you’ve walked through so far. Is there a convert step somewhere that you haven’t listed?</p>
<p>Can you provide a repro that demonstrates the error?</p>

username: MrOCW
cooked: <p>Yup! the actual quantization happens in ONNX. I’m referring to this <a href="https://github.com/neuralmagic/sparseml" class="inline-onebox" rel="noopener nofollow ugc">GitHub - neuralmagic/sparseml: Libraries for applying sparsification recipes to neural networks with a few lines of code, enabling faster and smaller models</a> repo for the ONNX quantization process. But that isnt the main issue here</p>

username: Vasiliy_Kuznetsov
cooked: <p>Would you have a small reproducible example to demonstrate the issue?  It would be hard to debug / provide some recommendation without more context.</p>