RuntimeError: ONNX export failed: Couldn't export operator aten::feature_dropout

Trying to export the PyTorch model into the ONNX and I’m getting ‘RuntimeError: ONNX export failed: Couldn’t export operator aten::feature_dropout’ this error and one warning ‘UserWarning: ONNX export failed on feature_dropout because training mode not supported’. I’m new to PyTorch and I’m not able to find out where is the issue?

Have you tried model.eval() before exporting? I’m not sure if torch.onnx.export does this for you. That will skip/turn off any training only related operations such as drop out or injected noise etc.