Couldn't quantize the model I used

vishak_bharadwaj: <p>I have a notebook here that has a image classifier skeleton</p><aside class="onebox githubblob" data-onebox-src="https://github.com/VishakBharadwaj94/CNN_starter/blob/main/CNN_Boilerplate.ipynb">
  <header class="source">

      <a href="https://github.com/VishakBharadwaj94/CNN_starter/blob/main/CNN_Boilerplate.ipynb" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/VishakBharadwaj94/CNN_starter/blob/main/CNN_Boilerplate.ipynb" target="_blank" rel="noopener nofollow ugc">VishakBharadwaj94/CNN_starter/blob/main/CNN_Boilerplate.ipynb</a></h4>


      <pre><code class="lang-ipynb">{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19",
    "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5"
   },
   "source": [
    "# CNN outline for DL with CIFAR10\n",
    "\n",
    "![cifar10](https://miro.medium.com/max/709/1*LyV7_xga4jUHdx4_jHk1PQ.png)\n",
    "\n",
    "\n",
    "In this tutorial, we'll use the following techniques to achieve over 90% accuracy in less than 5 minutes:\n",
    "\n",
    "- Data normalization\n",
    "- Data augmentation\n",
    "- Residual connections\n",
    "- Batch normalization\n",
</code></pre>



  This file has been truncated. <a href="https://github.com/VishakBharadwaj94/CNN_starter/blob/main/CNN_Boilerplate.ipynb" target="_blank" rel="noopener nofollow ugc">show original</a>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>I tried to fuse layers and quantize the model as in the video but got an error.</p><div class="youtube-onebox lazy-video-container" data-video-id="jdE4hPf9juk" data-video-title="Deploying your ML Model with TorchServe" data-provider-name="youtube">
  <a href="https://www.youtube.com/watch?v=jdE4hPf9juk" target="_blank" rel="noopener nofollow ugc">
    <img class="youtube-thumbnail" src="https://img.youtube.com/vi/jdE4hPf9juk/maxresdefault.jpg" title="Deploying your ML Model with TorchServe" width="690" height="388">
  </a>
</div>

<p>Are there any best practices for writing your model etc that overcome this problem?<br>
Thanks!</p>

vishak_bharadwaj: <p>Hi guys any pointers would be helpful here!</p>

ptrblck: <p>Your notebook doesn’t show any error, so could you describe what issues you are seeing and what you’ve tried so far?</p>

vishak_bharadwaj: <p>Hi Patrick, the issue arose when I ended up using Torchserve. The API broke, and it worked when I tried a straight MNIST classifier with a clean architecture. What I mean here is that the model didn’t call a small conv function that has a ( conv_bn_relu) combo.</p>

ptrblck: <p>How did you check that this modules wasn’t called? Did you get any error message or do you think Torchserve just skipped this module somehow?</p>

vishak_bharadwaj: <p>Got an error messgae <a class="mention" href="/u/ptrblck">@ptrblck</a></p>
<p>Let me organize this into a full question with pics and error messages. It will help people. Please give me an hour.</p>

vishak_bharadwaj: <p>LOL ok I got my question completely wrong. The Torchserve issue was completely different since I’d screwed up the ModelHandler  messing up the preprocess method</p>
<p>The quantization is different, but I still haven’t figured it out yet.  Here’s the model.<br>
I’m not sure how I can quantize this, compared to this sweet simple tutorial.</p>
<aside class="onebox githubblob">
  <header class="source">
      <a href="https://github.com/VishakBharadwaj94/quant_wip/blob/master/quant.ipynb" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>
  <article class="onebox-body">
    <h4><a href="https://github.com/VishakBharadwaj94/quant_wip/blob/master/quant.ipynb" target="_blank" rel="noopener nofollow ugc">VishakBharadwaj94/quant_wip/blob/master/quant.ipynb</a></h4>
<pre><code class="lang-ipynb">{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "quant.ipynb",
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "id": "Eay3SI8fa6P9"
      },
</code></pre>

  This file has been truncated. <a href="https://github.com/VishakBharadwaj94/quant_wip/blob/master/quant.ipynb" target="_blank" rel="noopener nofollow ugc">show original</a>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>