zixuanweeei edited a comment on issue #16256: [Bug] Failed to evaluate gradient 
on samples with train_mode=False
URL: 
https://github.com/apache/incubator-mxnet/issues/16256#issuecomment-534925721
 
 
   Thanks for reporting this issue. Actually, we need a workspace to store the 
intermediate result of RNN variants, like the output of every gate and the 
state of every step, which are created only when `is_train=True`. These 
intermediate results are used in the gradients' calculation. When 
`train_mode=False` (`is_train=False`), no workspace will be created in 
`Forward`. So it will raise the error in `Backward`.
   
   As to dropout, mxnet-mkl doesn't support it. But you can `export 
MXNET_USE_MKLDNN_RNN=0` to force MXNet run into the naive CPU-RNN path, where 
dropout are enabled. If you don't set `MXNET_USE_MKLDNN_RNN=0`, it should be 
`1` by default, which means that MKL-DNN RNN path without dropout enabled will 
be executed.
   
   For now, we don't have a good solution for your request. RNN operator has a 
different machnism than other operators. I will look for a solution. Any 
insights? @ZhiminPeng 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to