Closed YRChen1998 closed 2 years ago
Please try latest PR: https://github.com/deepjavalibrary/djl/pull/2027
Thanks, This bug comes from MXNET's rnn.begin_state. Here's a temporary solution: in the prediction_net-symbol.json
model file, you can manually change the batch_size
of every begin_state operation's shape
to -1.
It should be like
{
"op": "_zeros",
"name": "deeparpredictionnetwork0_deeparpredictionnetwork0_lstm0_begin_state_0",
"attrs": {
"__layout__": "NC",
"dtype": "float32",
"shape": "(0, 40)" // change every begin_state's shape to (-1, 40)
},
"inputs": []
}
You can also directly download the model from our server, where the change is already done. In the latest PR https://github.com/deepjavalibrary/djl/pull/2027, this model with the modification is automatically downloaded.
It works. Thanks a lot and look forward to more implements on the Gluon-TS extension.
Description
I tried to use DJL to do forecast with a demo model trainded by Gluon-TS, but there is something wrong. Here is my Gluon-TS code:
Then I got the model files and put them to DJL Directory:
But there is something wrong when I ran the DJL inference codes which is in [timeseries] add m5 demo and a simple demo #2055
Error Message
Caused by: ai.djl.engine.EngineException: MXNet engine call failed: MXNetError: Error in operator deeparpredictionnetwork0_lstm0_t0_plus0: [14:13:50] /Users/runner/work/djl/djl/src/ndarray/../operator/tensor/../elemwise_op_common.h:134: Check failed: assign(&dattr, vec.at(i)): Incompatible attr in node deeparpredictionnetwork0_lstm0_t0_plus0 at 1-th input: expected [1,160], got [0,160]
What have you tried to solve it?
Environment Info
I want to take gluon-ts trained models to production, so I think DJL is a good choice. Are there some solutions to solve the problem?