Onnx export error with dict?

got this error:
File “/usr/local/lib/python3.5/dist-packages/torch/jit/init.py”, line 201, in forward
out_vars, _ = _flatten(out)

Only tuples, lists and Variables supported as JIT inputs, but got dict

But impossible to know where exactly it was triggered in the code
it seems similar to:



answering to myself:

a forward in a nn.Module cannot return a dict, which is really too bad.

1 Like

It helped me. You found some turnaround if I need to return dictionary or tuple? Only thing I can think right now is global variable.