Converting PyTorch to coremltools does not work

Hello. Converting pytorch model to coreml does not work. My model structure:

https://stackoverflow.com/questions/66961204/converting-pytorch-to-coremltools-does-not-work

Code Block
mlmodel = ct.convert(
traced_model,
inputs=[ct.TensorType(name="input", shape=dummy_input.shape)]
)


In this case, I use the torch.FloatTensor. The conversion is successful by 99 percent, and then the process is suspended and there is no success.

If i use torch.HalfTensor, i got KeyError: 5

Help solve the problem.




Converting PyTorch to coremltools does not work
 
 
Q