You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to convert the RTDETR Object Detection model to CoreML for use in an iOS app. However, I am encountering a data type mismatch error during the conversion process.
The code i am using:
import torch
import coremltools as ct
from transformers import RTDetrForObjectDetection
model = RTDetrForObjectDetection.from_pretrained("TMP-finetune/runs/Jan22_16-22-29")
example_input = (torch.rand(1, 3, 512, 512),)
# Generate ExportedProgram by exporting
exported_model = torch.export.export(model, example_input)
input_images = ct.ImageType(name="images", shape=example_input[0].shape)
# Convert the model
mlmodel = ct.convert(
exported_model,
inputs=[input_images]
)
# Save the Core ML model
mlmodel.save("best.mlmodel")
The error i am getting:
I have tried searching for solutions but haven't found a way to resolve this data type mismatch issue. Any guidance or suggestions would be greatly appreciated.
I am trying to convert the RTDETR Object Detection model to CoreML for use in an iOS app. However, I am encountering a data type mismatch error during the conversion process.
The code i am using:
The error i am getting:
I have tried searching for solutions but haven't found a way to resolve this data type mismatch issue. Any guidance or suggestions would be greatly appreciated.
I have also opened a related issue on another repository, which can be found here: huggingface/transformers#35905 (comment)
Thanks in advance
The text was updated successfully, but these errors were encountered: