After defining the model I get an error like below when converting to 'torchscript'
RuntimeError Traceback (most recent call last)
[<ipython-input-37-277f5d3f2bc7>](https://localhost:8080/#) in <module>
----> 1 trace = torch.jit.trace(model, dummy_input)
1 frames
[/usr/local/lib/python3.8/dist-packages/torch/jit/_trace.py](https://localhost:8080/#) in trace(func, example_inputs, optimize, check_trace, check_inputs, check_tolerance, strict, _force_outplace, _module_class, _compilation_unit)
748
749 if isinstance(func, torch.nn.Module):
--> 750 return trace_module(
751 func,
752 {"forward": example_inputs},
[/usr/local/lib/python3.8/dist-packages/torch/jit/_trace.py](https://localhost:8080/#) in trace_module(mod, inputs, optimize, check_trace, check_inputs, check_tolerance, strict, _force_outplace, _module_class, _compilation_unit)
965 example_inputs = make_tuple(example_inputs)
966
--> 967 module._c._create_method_from_trace(
968 method_name,
969 func,
RuntimeError: Encountering a dict at the output of the tracer might cause the trace to be incorrect, this is only valid if the container structure does not change based on the module's inputs. Consider using a constant container instead (e.g. for `list`, use a `tuple` instead. for `dict`, use a `NamedTuple` instead). If you absolutely need this and know the side effects, pass strict=False to trace() to allow this behavior.
System info ・torch 1.12.1 ・coremltools 6.1 ・python 3.8.15
I tried to convert model of votenet to the Core ML format. I am referring to the following. https://coremltools.readme.io/docs/pytorch-conversion
After defining the model I get an error like below when converting to 'torchscript'
This is my code
I searched problem,then I found this https://github.com/huggingface/transformers/issues/9095
I changed code like this based on comments in the issue
But this time I got the following error
I'm a beginner, so maybe I'm stumbling on a rudimentary part Could you help me?