Post not yet marked as solved
Being brand new to create ML I tried to run my own ML project. When creating my own image classifier (same with tabular classification) I fail from the start. When selecting valid training data create ML says "Data Analysis stopped". I'm using Create ML Version 3.0 (78.7).
Any suggestions?
Post not yet marked as solved
this is the message i got as i tried to install tensorflow on my mac M1ship
ERROR: tensorflow_addons_macos-0.1a2-cp38-cp38-macosx_11_0_arm64.whl is not a supported wheel on this platform.
i have followed all the instruction as presented on the website can somebody help please.?
Post not yet marked as solved
Hi,
I would like to use a recent version of JAX on my new Macbook Pro with an M1 chip but unfortunately have run into the issue that tensorflow_macos seems to require numpy<=1.19 but JAX requires numpy>=1.20. Is there any way to manually compile tensorflow_macos with a newer numpy version? Or are you planning to release an update any time soon? Thanks!
Post not yet marked as solved
After collecting data I wanted to create an ML model I have done this before but for some reason I was getting the error:
error: Couldn't lookup symbols:
CreateML.MLDataTable.init(contentsOf: Foundation.URL, options: CreateML.MLDataTable.ParsingOptions) throws -> CreateML.MLDataTable
CreateML.MLDataTable.init(contentsOf: Foundation.URL, options: CreateML.MLDataTable.ParsingOptions) throws -> CreateML.MLDataTable
So I went to test a working example that was created by apple using this link: https://developer.apple.com/documentation/createml/creating_a_model_from_tabular_data
After running this test with no data changed, I still get the same error logged. I don't know if I'm doing something wrong. Any advice would be greatly appreciated.
Post not yet marked as solved
In a section of my app I would like to recommend restaurants to users based on certain parameters. Some parameters have a higher weighting than others. In this WWDC Video a very similar app is made.
Here if a user likes a dish a value of 1.0 is assigned to those specific keywords (that apple to the dish) with a value of -1.0 to all other keywords that don't apply to that dish.
For my app if the user has ordered I then apply a value of 1.0 (to the keywords that apply) but if a user has just expressed interest (but not ordered) then can I apply a value of 0.5 (and -0.5) instead, would the model adapt to this?
Post not yet marked as solved
Hi,
I have seen this video: https://developer.apple.com/videos/play/wwdc2021/10041/
and in my project i am trying to draw detected barcodes.
I am using Vision framework and i have the barcode position in boundingBox parameter, but i dont understand cgrect of that parameter.
I am programming in objective c and i don't see resources, and for more complication i have not an image, i am capturing barcodes from video camera sesion.
for parts:
1-how can i draw detected barcode like in the video (from an image).
2-how can i draw detected barcode in capturesession.
I have used VNImageRectForNormalizedRect to pass from normalized to pixel, but the result is not correct.
thank you very much.
Post not yet marked as solved
Hi, while I was able to successfully retrieve MLModelCollection with a list of model identifiers from Apple's CoreML Deployment Dashboard, loading encrypted models from a collection results in the following error:
NSUnderlyingError=0x281ffb810 {Error Domain=com.apple.CoreML Code=3 "failed to invoke mremap_encrypted with result = -1, error = 12" UserInfo={NSLocalizedDescription=failed to invoke mremap_encrypted with result = -1, error = 12}}}
I use the same MLModel.load(contentsOf:configuration:completionHandler:)
method with model URLs (from MLModelCollection) which works just fine for non–encrypted models.
Is there any workaround for this issue?
Post not yet marked as solved
I'm trying to apply TensorFlow-macOS to accelerate the fine-tune of hugging face transformer program on my Radeon Pro 5300M. However, there shows that "Cannot assign a device for operation", would it be possible to tell me why and how to solve this problem?
issues:
Version of TensorFlow-macOS is 2.5.0;
I've tried to update into 2.6.0, and it've worked. However, it's extremely slower than the 2.5.0 one. It would be a better way to fix 2.5.0 according to the 2.6.0, but I don't know how to do.
Post not yet marked as solved
as above.
I found that M1 Chip has extremely bad performance on training RNNs (158s vs 6h). Could anyone know why the M1 Pro chip is so unfriendly for RNNs? How can I only use CPU to run my code as mlcompute package cannot be recognized somehow.
Post not yet marked as solved
How to convert an existing mlmodel to mlprogram without source code?
It has been verified that coremltools.convert does not support coremltools.models.MLModel as source.
Post not yet marked as solved
Greetings.
I was shopping around for an external GPU and Machine Learning + GPU solution for my Mac.
Are there any suggestions? It looks like Keras 2.4 has dropped the multi backed support which is worrying.
I'm trying to make sure I make a purchase that will fly with what I have.
I'm using a Mac Mini (2018) with 64GB RAM. I have multiple Thunderbolt 3 ports. This is an Intel chipset machine, not an M1.
Is this feasible?
Post not yet marked as solved
I'm using Vision to conduct some OCR from a live camera feed. I've setup my VNRecognizeTextRequests as follows:
let request = VNRecognizeTextRequest(completionHandler: recognizeTextCompletionHandler)
request.recognitionLevel = .accurate
request.usesLanguageCorrection = false
And I handle the results as follows:
guard let observations = request.results as? [VNRecognizedTextObservation] else { return }
for observation in observations {
if let recognizedText = observation.topCandidates(1).first {
guard recognizedText.confidence >= self.confidenceLimit, // set to 0.5
let foundText = validateRegexPattern(text: recognizedText.string, regexPattern: self.regexPattern),
let foundDecimal = Double(foundText) else { continue }
}
This is actually working great and yielding very accurate results, but the confidence values I'm receiving from the results are generally either 0.5 or 1.0, and rarely 0.3. I find these to be pretty nonsensical confidence values and I'm wondering if this is the intended result or some sort of bug. Conversely, using recognitionLevel = .fast yields more realistic and varied confidence values, but much less accurate results overall (even though fast is recommended for OCR from a live camera feed, I've had significantly better results using the accurate recognition level, which is why I've been using the accurate recognition level)
Post not yet marked as solved
Hi all, I've spent some time experimenting with the BNNS (Accelerate) LSTM-related APIs lately and despite a distinct lack of documentation (even though the headers have quite a few) a got most things to a point where I think I know what's going on and I get the expected results.
However, one thing I have not been able to do is to get this working if inputSize != hiddenSize.
I am currently only concerned with a simple unidirectional LSTM with a single layer but none of my permutations of gate "iw_desc" matrices with various 2D layouts and reordering input-size/hidden-size made any difference, ultimately BNNSDirectApplyLSTMBatchTrainingCaching always returns -1 as an indication of error.
Any help would be greatly appreciated.
PS: The bnns.h framework header file claims that "When a parameter is invalid or an internal error occurs, an error message will be logged. Some combinations of parameters may not be supported. In that case, an info message will be logged.", and yet, I've not been able to find any such messages logged to NSLog() or stderr or Console. Is there a magic environment variable that I need to set to get more verbose logging?
Post not yet marked as solved
I just got my new MacBook Pro with M1 Max chip and am setting up Python. I've tried several combinational settings to test speed - now I'm quite confused. First put my questions here:
Why python run natively on M1 Max is greatly (~100%) slower than on my old MacBook Pro 2016 with Intel i5?
On M1 Max, why there isn't significant speed difference between native run (by miniforge) and run via Rosetta (by anaconda) - which is supposed to be slower ~20%?
On M1 Max and native run, why there isn't significant speed difference between conda installed Numpy and TensorFlow installed Numpy - which is supposed to be faster?
On M1 Max, why run in PyCharm IDE is constantly slower ~20% than run from terminal, which doesn't happen on my old Intel Mac.
Evidence supporting my questions is as follows:
Here are the settings I've tried:
1. Python installed by
Miniforge-arm64, so that python is natively run on M1 Max Chip. (Check from Activity Monitor, Kind of python process is Apple).
Anaconda.: Then python is run via Rosseta. (Check from Activity Monitor, Kind of python process is Intel).
2. Numpy installed by
conda install numpy: numpy from original conda-forge channel, or pre-installed with anaconda.
Apple-TensorFlow: with python installed by miniforge, I directly install tensorflow, and numpy will also be installed. It's said that, numpy installed in this way is optimized for Apple M1 and will be faster. Here is the installation commands:
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
3. Run from
Terminal.
PyCharm (Apple Silicon version).
Here is the test code:
import time
import numpy as np
np.random.seed(42)
a = np.random.uniform(size=(300, 300))
runtimes = 10
timecosts = []
for _ in range(runtimes):
s_time = time.time()
for i in range(100):
a += 1
np.linalg.svd(a)
timecosts.append(time.time() - s_time)
print(f'mean of {runtimes} runs: {np.mean(timecosts):.5f}s')
and here are the results:
+-----------------------------------+-----------------------+--------------------+
| Python installed by (run on)→ | Miniforge (native M1) | Anaconda (Rosseta) |
+----------------------+------------+------------+----------+----------+---------+
| Numpy installed by ↓ | Run from → | Terminal | PyCharm | Terminal | PyCharm |
+----------------------+------------+------------+----------+----------+---------+
| Apple Tensorflow | 4.19151 | 4.86248 | / | / |
+-----------------------------------+------------+----------+----------+---------+
| conda install numpy | 4.29386 | 4.98370 | 4.10029 | 4.99271 |
+-----------------------------------+------------+----------+----------+---------+
This is quite slow. For comparison,
run the same code on my old MacBook Pro 2016 with i5 chip - it costs 2.39917s.
another post reports that run with M1 chip (not Pro or Max), miniforge+conda_installed_numpy is 2.53214s, and miniforge+apple_tensorflow_numpy is 1.00613s.
you may also try on it your own.
Here is the CPU information details:
My old i5:
$ sysctl -a | grep -e brand_string -e cpu.core_count
machdep.cpu.brand_string: Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
machdep.cpu.core_count: 2
My new M1 Max:
% sysctl -a | grep -e brand_string -e cpu.core_count
machdep.cpu.brand_string: Apple M1 Max
machdep.cpu.core_count: 10
I follow instructions strictly from tutorials - but why would all these happen? Is it because of my installation flaws, or because of M1 Max chip? Since my work relies heavily on local runs, local speed is very important to me. Any suggestions to possible solution, or any data points on your own device would be greatly appreciated :)
Post not yet marked as solved
wwdc20-10673 briefly shows how to visualize optical flow generated by VNGenerateOpticalFlowRequest and sample code is available through the developer app. But how can we build the OpticalFlowVisualizer.ci.metallib file from the CI-kernel code provided as OpticalFlowVisualizer.cikernel?
Post not yet marked as solved
It seems it didn't get much attention since it's lost in another thread.
tf.random is broken since 12.1.
import tensorflow as tf
x = tf.random.uniform((10,))
y = tf.random.uniform((10,))
tf.print(x)
tf.print(y)
[0.178906798 0.8810848 0.384304762 ... 0.162458301 0.64780426 0.0123682022]
[0.178906798 0.8810848 0.384304762 ... 0.162458301 0.64780426 0.0123682022]
works fine on collab, worked on 12.0, It also works fine if I disable GPU with :
tf.config.set_visible_devices([], 'GPU')
WORKAROUND :
g = tf.random.Generator.from_non_deterministic_state()
x = g.uniform((10,))
y = g.uniform((10,))
Post not yet marked as solved
Is it possible to use SNAudioFileAnalyzer with live HLS(m3u8) stream? Maybe we need to extract somehow audio from it?
And Can we use SNAudioFileAnalyzer with real remote url? Or we can use it only with files in file system?
Post not yet marked as solved
Is it possible to do any of the following:
Export a model created using MetalPerformanceShadersGraph to a CoreML file;
Failing 1., save a trained MetalPerformanceShadersGraph model in any other way for deployment;
Import a CoreML model and use it as a part of a MetalPerformanceShadersGraph model.
Thanks!
Post not yet marked as solved
Hello! I’m having an issue with retrieving the trained weights from MLCLSTMLayer in ML Compute when training on a GPU. I maintain references to the input-weights, hidden-weights, and biases tensors and use the following code to extract the data post-training:
extension MLCTensor {
func dataArray<Scalar>(as _: Scalar.Type) throws -> [Scalar] where Scalar: Numeric {
let count = self.descriptor.shape.reduce(into: 1) { (result, value) in
result *= value
}
var array = [Scalar](repeating: 0, count: count)
self.synchronizeData() // This *should* copy the latest data from the GPU to memory that’s accessible by the CPU
_ = try array.withUnsafeMutableBytes { (pointer) in
guard let data = self.data else {
throw DataError.uninitialized // A custom error that I declare elsewhere
}
data.copyBytes(to: pointer)
}
return array
}
}
The issue is that when I call dataArray(as:) on a weights or biases tensor for an LSTM layer that has been trained on a GPU, the values that it retrieves are the same as they were before training began. For instance, if I initialize the biases all to 0 and then train the LSTM layer on a GPU, the biases values seemingly remain 0 post-training, even though the reported loss values decrease as you would expect.
This issue does not occur when training an LSTM layer on a CPU, and it also does not occur when training a fully-connected layer on a GPU. Since both types of layers work properly on a CPU but only MLCFullyConnectedLayer works properly on a GPU, it seems that the issue is a bug in ML Compute’s GPU implementation of MLCLSTMLayer specifically.
For reference, I’m testing my code on M1 Max.
Am I doing something wrong, or is this an actual bug that I should report in Feedback Assistant?
Post not yet marked as solved
I want to detect an image of a dart target (https://commons.wikimedia.org/wiki/File:WA_80_cm_archery_target.svg) in my iOS app.
For that I am creating an object detector with CreateML. I am using the Transfer Learning algorithm and 114 annotated images, the validation data is set to auto.
After 2000 iterations I got the following stats: 96% Training and 0% Validation.
As I understand it, the percentages are the I/U 50% scores (= percentage of intersection over union ratios from the bounding boxes with over 50%).
If the validation data is automatically chosen from the set of images, how can its score be 0%?