How to use the Generated Bundle

Kittu28: <p>With the command  <code>model-compiler -backend=CPU -model=&lt;model-path&gt; -emit-bundle=&lt;bundle-dir&gt;</code> , Bundle is generated for the model resnet18.onnx.<br>
As said  <a href="https://github.com/pytorch/glow/blob/master/docs/AOT.md#cross-compile-a-bundle-for-a-specific-architecture" rel="noopener nofollow ugc">here</a> I want to use that generated bundle and give a image as input and classify to what class that image belongs to.<br>
I realize i have to write my own code for it and fed the input to it… something like that…So… Can you  please tell me how to do it.</p>

jfix: <p>There is a section on the README for how to use a bundle <a href="https://github.com/pytorch/glow/blob/master/docs/AOT.md#how-to-use-the-bundle" rel="noopener nofollow ugc">here</a>. Additionally there are some examples located <a href="https://github.com/pytorch/glow/tree/master/examples/bundles" rel="noopener nofollow ugc">here</a>.</p>

Kittu28: <p>There is a main.cpp in resnet50.cpp and four files are generated in the bundle .h .bin .o .txt<br>
Now how should the command look like to run it? I tried like this and got such error…<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/a/4a18c03f599ddc62843288a6db64502c67f3e87f.png" data-download-href="https://discuss.pytorch.org/uploads/default/4a18c03f599ddc62843288a6db64502c67f3e87f" title="Screenshot from 2021-04-07 12-43-46"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4a18c03f599ddc62843288a6db64502c67f3e87f_2_690x392.png" alt="Screenshot from 2021-04-07 12-43-46" data-base62-sha1="azumpF4Hsg6s4dxkxJbaGfS4Qwf" width="690" height="392" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4a18c03f599ddc62843288a6db64502c67f3e87f_2_690x392.png, https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4a18c03f599ddc62843288a6db64502c67f3e87f_2_1035x588.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4a18c03f599ddc62843288a6db64502c67f3e87f_2_1380x784.png 2x" data-dominant-color="36132C"><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">Screenshot from 2021-04-07 12-43-46</span><span class="informations">1853×1053 227 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>

jfix: <p>There’s a makefile, you can follow it or use it to compile for you (or see the commands it uses): <a href="https://github.com/pytorch/glow/blob/master/examples/bundles/resnet50/CMakeLists.txt" class="inline-onebox" rel="noopener nofollow ugc">glow/CMakeLists.txt at master · pytorch/glow · GitHub</a></p>

Kittu28: <p>It is working fine when i directly take the .h .o .bin files which are generated by GLOW itself in <a href="https://github.com/pytorch/glow/blob/master/docs/AOT.md#overview" rel="noopener nofollow ugc">here</a> but when i generated explicitly(.h .o .bin files) by using the commands as provided <a href="https://github.com/pytorch/glow/blob/master/docs/AOT.md#compile-a-bundle-for-a-floating-point-model" rel="noopener nofollow ugc">here</a>, it isn’t working when i create the executable. The files generated are also not same. How are the bundle files generated by GLOW in the first case,which Model is used to generate it…?</p>

jfix: <p>The models are e.g. resnet50 we have available in our AWS bin for public testing. If you are having issues specific to the <code>model-compiler</code> I’d suggest filing an issue on the Glow Github page and tagging <code>mciprian13</code> who is its main contributor.</p>

Kittu28: <p>I changed the model then it worked. It is for caffe2 resnet50 model .Earlier i was trying for resnet50 onnx model so thats why it didn’t work.</p>