How to execute a onnx model having LSTM feature with Glow compiler

username: Compiler-team-1
cooked: <p>Here we’re using  a LSTM model which predicts the sentence by giving input of string, it works fine with torchvision without using glow compiler.<br>
How to convert the model into onnx format and what are the steps for running onnx model using Glow compiler?</p>

username: jfix
cooked: <p>If you specifically want to go the ONNX path, you should be able to export to ONNX using instructions <a href="https://pytorch.org/docs/stable/onnx.html" rel="nofollow noopener">here</a>.</p>
<p>Once it’s in ONNX format you can load it through our Loader class, and run it on any Glow backend (assuming it has sufficient support) using instructions <a href="https://github.com/pytorch/glow/blob/master/docs/Testing.md#model-loader" rel="nofollow noopener">here</a>. However note that it sounds like you will need to build your own custom Loader class for this (perhaps similar to our <code>text-translator</code> which you can find info about in the above link).</p>

username: Compiler-team-1
cooked: <p>I am running a LSTM model which is in onnx format but i am getting error as below:</p>
<p>./bin/model-compiler -m /home/hemanth/lstm_new.onnx -emit-bundle=/home/Desktop<br>
WARNING: Logging before InitGoogleLogging() is written to STDERR<br>
F1223 11:42:51.549001 30189 Error.cpp:119] exitOnError(Error) got an unexpected ErrorValue:<br>
Error message: No node under name lstm_h<br>
Error return stack:<br>
/home/glow/lib/Importer/ProtobufLoader.cpp:110<br>
/home/glow/include/glow/Importer/CommonOperatorLoader.h:584<br>
/home/glow/include/glow/Importer/CommonOperatorLoader.h:1128<br>
/home/glow/lib/Importer/ONNXModelLoader.cpp:1763<br>
/home/glow/lib/Importer/ONNXModelLoader.cpp:1940<br>
/home/glow/lib/Importer/ONNXModelLoader.cpp:2028<br>
/home/glow/lib/Importer/ONNXModelLoader.cpp:2042<br>
*** Check failure stack trace: ***<br>
<span class="hashtag">#0</span> 0x00000000006a512a llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;) (./bin/model-compiler+0x6a512a)<br>
<span class="hashtag">#1</span> 0x00000000006a30bc llvm::sys::RunSignalHandlers() (./bin/model-compiler+0x6a30bc)<br>
<span class="hashtag">#2</span> 0x00000000006a3227 SignalHandler(int) (./bin/model-compiler+0x6a3227)<br>
<span class="hashtag">#3</span> 0x00007fa0fcc41390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)<br>
<span class="hashtag">#4</span> 0x00007fa0fbdcb428 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35428)<br>
<span class="hashtag">#5</span> 0x00007fa0fbdcd02a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3702a)<br>
<span class="hashtag">#6</span> 0x00007fa0fca0ae49 (/usr/lib/x86_64-linux-gnu/libglog.so.0+0x9e49)<br>
<span class="hashtag">#7</span> 0x00007fa0fca0c5cd (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xb5cd)<br>
<span class="hashtag">#8</span> 0x00007fa0fca0e433 google::LogMessage::SendToLog() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xd433)<br>
<span class="hashtag">#9</span> 0x00007fa0fca0c15b google::LogMessage::Flush() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xb15b)<br>
<span class="hashtag">#10</span> 0x00007fa0fca0ee1e google::LogMessageFatal::~LogMessageFatal() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xde1e)<br>
<span class="hashtag">#11</span> 0x00000000025cd9ca glow::detail::exitOnError(char const*, unsigned long, glow::detail::GlowError) (./bin/model-compiler+0x25cd9ca)<br>
<span class="hashtag">#12</span> 0x00000000005ff7db glow::ONNXModelLoader::ONNXModelLoader(std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt; const&amp;, llvm::ArrayRef&lt;char const*&gt;, llvm::ArrayRef&lt;glow::Type const*&gt;, glow::Function&amp;, glow::detail::GlowError*, bool) (./bin/model-compiler+0x5ff7db)<br>
<span class="hashtag">#13</span> 0x0000000000454540 main (./bin/model-compiler+0x454540)<br>
<span class="hashtag">#14</span> 0x00007fa0fbdb6830 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20830)<br>
<span class="hashtag">#15</span> 0x00000000004fb909 _start (./bin/model-compiler+0x4fb909)<br>
Aborted (core dumped)</p>