Questions tagged [coreml]
Apple's Core ML framework and tools for making predictions using machine learning. Supports a variety of regression and classification models, as well as general-purpose neural networks.
coreml
939
questions
0
votes
1
answer
31
views
Error converting Tensorflow model to CoreML model
NotImplementedError Traceback (most recent call last)
Cell In[19], line 1
----> 1 mlmodel = ct.convert(model, convert_to="mlmodel", source="tensorflow")
...
0
votes
0
answers
31
views
Error while exporting Tensorflow model to CoreML
'Sequential' object has no attribute '_get_save_spec'
import tensorflow as tf
import coremltools as ct
print(tf.__version__)
# Load your existing Keras model
model_path = "/Users/name/Desktop/...
0
votes
0
answers
26
views
Image recognition CoreMl + SwiftUi.... Issue with view
I'm experiencing an issue with my SwiftUI project that uses Firebase and a CoreML model for image recognition. Despite adding various debug print statements, the process doesn't proceed beyond the ...
0
votes
0
answers
34
views
Exporting a Bert-based PyTorch model to CoreML. How can I make the CoreML model work for any input?
I use the code below to export a Bert-based PyTorch model to CoreML.
Since I used
dummy_input = tokenizer("A French fan", return_tensors="pt")
the CoreML model only works with ...
0
votes
0
answers
39
views
How can one convert a .mlpackage Core ML model to a .mlmodel Core ML model?
How can one convert a .mlpackage model to a .mlmodel model?
Example of a .mlpackage Core ML model created on Ubuntu 20.04 (tested with Python 3.10 and torch 2.3.1) with Hugging Face's Exporters lib:
...
-3
votes
1
answer
46
views
How can one run a Core ML model on macOS 10.12?
https://developer.apple.com/documentation/coreml mentions macOS 10.13+:
How can one run a Core ML model on macOS 10.12?
Example of a Core ML model created on Ubuntu 20.04 (tested with Python 3.10 ...
0
votes
1
answer
71
views
"RuntimeError: BlobWriter not loaded" error when exporting a PyTorch model to CoreML. How to fix it?
I get a "RuntimeError: BlobWriter not loaded" error when exporting a PyTorch model to CoreML. How to fix it?
Same issue with Python 3.11 and Python 3.10. Same issue with torch 2.3.1 and 2.2....
0
votes
0
answers
107
views
"Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'"when converting an ONNX model to CoreML with onnx-coreml lib. How to fix?
I try to use the onnx-coreml lib to convert an ONNX model to CoreML:
import onnx
from onnx_coreml import convert
onnx_model = onnx.load('model.onnx')
coreml_model = convert(onnx_model)
coreml_model....
0
votes
0
answers
52
views
How can I export a tokenizer from Huggingface transformers to CoreML?
I load a tokenizer and a Bert model from Huggingface transformers, and export the Bert model to CoreML:
from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch
# Load the ...
1
vote
2
answers
99
views
Japanese Vertical text recognition with VNRecognizeTextRequest not working
I'm using the Apple OCR capabilities provided by the Vision Framework to recognize text in images. While I've had great success with horizontal text in Japanese, Korean, and Chinese, I'm encountering ...
0
votes
0
answers
33
views
CoreML object detection works in Xcode model preview but not in code with VNCoreMLRequest
I've been working on an object detection project for several weeks now. I've finally got the model detecting my objects accurately, with a near 90% confidence interval for most objects.
When I pull ...
0
votes
0
answers
29
views
The Coreml Model I Converted Using YOLOV is Performing Very Poorly in The iOS Application
I converted my custom model trained with YOLOv8m to a CoreML model:
from ultralytics import YOLO
model_path="{best.pt model}"
model=YOLO(model_path)
model.export(format='coreml', nms=True, ...
0
votes
1
answer
21
views
Troubleshooting onnxruntime inference - X num_dims does not match W num_dims
Using the nnhash.py script found here: https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX
# Copyright 2021 Asuhariet Ygvar
#
# Licensed under the Apache License, Version 2.0 (the "License&...
0
votes
0
answers
30
views
Race Conditions and Queue Usage in Swift Project Using CoreMotion, CoreML, and WatchConnectivity
I am working on a Swift project involving CoreMotion, CoreML, and WatchConnectivity. The setup involves a Watch app sending CoreMotion data to a phone app at a rate of 0.1 seconds. The phone app ...
1
vote
0
answers
36
views
If a PyTorch model can be converted to onnx, can it always be converted to CoreML?
If a PyTorch model can be converted to ONNX, can it always be converted to CoreML?