-
Notifications
You must be signed in to change notification settings - Fork 682
Converting Faster-RCNN from PyTorch to CoreML #2479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@gizzleon just out of curiosity: coremltools, torch, and torchvision had newer releases in January. And when I install coremltools, numpy 2.2 is being used, wasn't that the case for you? |
@reneleonhardt The issue persists on newer versions of coremltools 8.2, torch 2.6.0 and torchvision 0.21.0. I am not able to use numpy 2.x as |
I can't find any deprecations in 2.0, 2.1 or 2.2 regarding copy or these two function calls. Release notes say numpy 2 is supported: If you have time maybe you can open another issue for your environment 🙂 |
It is a behavior change on the copy keyword rather than a deprecation. Sorry for the confusion. The log I got with numpy 2.2.4:
Unfortunately I couldn't encapsulate and create a smaller sample for reproduction. The issue goes away when I'm converting a minimal network with |
Interesting, now I can see what you mean, thank you! |
🐞Describing the bug
Hi, I am converting a PyTorch Faster R-CNN model to CoreML and encountered data type mismatching issue, which may be related to #2440
The model I'm converting is
torchvision.models.detection.faster_rcnn.fasterrcnn_resnet50_fpn_v2
.The first issue was the unsupported
torchvision::roi_align
operator. With the implementation from this PR, I was able to convert a singleRoIAlign
layer.However, when converting the whole Faster R-CNN model, the second input variable
rois
has unexpected shape(0,1)
and dtypeint32
, where it is supposed to be a(N,5)
float tensor.Stack Trace
To Reproduce
System environment:
The text was updated successfully, but these errors were encountered: