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

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.
How to convert the model into onnx format and what are the steps for running onnx model using Glow compiler?

If you specifically want to go the ONNX path, you should be able to export to ONNX using instructions here.

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 here. However note that it sounds like you will need to build your own custom Loader class for this (perhaps similar to our text-translator which you can find info about in the above link).

I am running a LSTM model which is in onnx format but i am getting error as below:

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