Cannot assign a device for operation encoder/down1/downs_0/conv1/weight/Initializer/random_uniform/RandomUniform: Could not satisfy explicit device specification '' because the node {{colocation_node encoder/down1/downs_0/conv1/weight/Initializer/random_uniform/RandomUniform}} was colocated with a group of nodes that required incompatible device '/device:GPU:0'. All available devices [/job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:GPU:0].
Colocation Debug Info:
Colocation group had the following types and supported devices:
Root Member(assigned_device_name_index_=-1 requested_device_name_='/device:GPU:0' assigned_device_name_='' resource_device_name_='/device:GPU:0' supported_device_types_=[CPU] possible_devices_=[]
Identity: GPU CPU
Mul: GPU CPU
AddV2: GPU CPU
Sub: GPU CPU
RandomUniform: GPU CPU
Assign: CPU
VariableV2: GPU CPU
Const: GPU CPU
General
RSS for tagExplore the power of machine learning within apps. Discuss integrating machine learning features, share best practices, and explore the possibilities for your app.
Post
Replies
Boosts
Views
Activity
followed instruction in
https://developer.apple.com/metal/jax/
I got
Successfully installed importlib-metadata-7.1.0 jax-0.4.28 jax-metal-0.0.7 jaxlib-0.4.28 opt-einsum-3.3.0 scipy-1.13.0 six-1.16.0 zipp-3.18.2
but the test failed
python -c 'import jax; print(jax.numpy.arange(10))'
Traceback (most recent call last):
File "", line 1, in
File "/Users/erivas/jax-metal/lib/python3.9/site-packages/jax/init.py", line 37, in
import jax.core as _core
File "/Users/erivas/jax-metal/lib/python3.9/site-packages/jax/core.py", line 18, in
from jax._src.core import (
File "/Users/erivas/jax-metal/lib/python3.9/site-packages/jax/_src/core.py", line 39, in
from jax._src import dtypes
File "/Users/erivas/jax-metal/lib/python3.9/site-packages/jax/_src/dtypes.py", line 33, in
from jax._src import config
File "/Users/erivas/jax-metal/lib/python3.9/site-packages/jax/_src/config.py", line 27, in
from jax._src import lib
File "/Users/erivas/jax-metal/lib/python3.9/site-packages/jax/_src/lib/init.py", line 84, in
cpu_feature_guard.check_cpu_features()
RuntimeError: This version of jaxlib was built using AVX instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.
Hi
I have only recently started working on ML on my Mac M1 Pro, previously I was working on a Windows platform. I am having difficulties getting my machine set up right so that its ready for the super fast training I was hoping for when I got it. Please help me with this and let me know if and where I am going wrong.
So, I tried a custom dataset training using Yolov8 model. I want to train for a 100 epochs. Now the same dataset and hyperparameters take about 2.5 hours on a T4 GPU on Google Colab, whereas I was only at around 60 epochs after 24 hours on my M1 pro.
I have home brew, miniconda, pytorch nightly for mac installed and set the device to mps when training the YOLO model. I feel that this is reaaallly slow. What should I be doing right?
Thank you
Lakshmi
Hi, this is the 3rd time I'm trying to post this on the forum, apple moderators ignoring it.
I'm a deep learning expert with a specialization of image processing.
I want to know why I have hundreds of AI models on my Mac that are indexing everything on my computer while it is idle, using programs like neuralhash that I can't find any information about.
I can understand if they are being used to enhance the user experience on Spotlight, Siri, Photos, and other applications, but I couldn't find the necessary information on the web.
Usually, (spyware) software like this uses them to classify files in an X/Y coordinate system. This feels like a more advanced version of stuxnet.
find / -type f -name "*.weights" > ai_models.txt
find / -type f -name "*labels*.txt" > ai_model_labels.txt
Some of the classes from the files;
file_name: SCL_v0.3.1_9c7zcipfrc_558001-labels-v3.txt
document_boarding_pass
document_check_or_checkbook
document_currency_or_bill
document_driving_license
document_office_badge
document_passport
document_receipt
document_social_security_number
hier_curation
hier_document
hier_negative
curation_meme
file_name: SceneNet5_detection_labels-v8d.txt
CVML_UNKNOWN_999999
aircraft
automobile
bicycle
bird
bottle
bus
canine
consumer_electronics
feline
fruit
furniture
headgear
kite
fish
computer_monitor
motorcycle
musical_instrument
document
people
food
sign
watersport
train
ungulates
watercraft
flower
appliance
sports_equipment
tool
Hi all, I couldn't use random.PRNGKey to generate random seed. Wondering anyone has similar issue before and figure this out. Here is my current config: jax-metal==0.0.3, jaxlib==0.4.10, jax==0.4.11.
I am using Apple M1 pro.
Does the new Image Playground API allow programmatically generating images? Can the app generate and use them without the API's UI or would that require using another generative image model?
I have a Shortcuts action via an App Intent that I want only for active subscribers to use.
I have a shared class that handles all the subcription related things. But for some reason my code only works if the app is active in the background. Once the app is quitted and the user performs the Shortcut, the not subscribed error is thrown – even though the user is subscribed.
How can I ensure that my subscription check is done correctly, if the app isn’t open in the background?
My Code
App Intent excerpt:
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<MeterIntentEntity> {
// Validate that the user is subscribed.
// Cancels action with error message if not subscribed.
if SubscriptionManager.shared.userIsSubscribed == false {
throw IntentError.notSubscribed
}
// More Code …
// Finish and pass created value as result.
return .result(value: something)
}
Subscription Manager excerpt:
class SubscriptionManager: ObservableObject {
// A singleton for our entire app to use
static let shared = SubscriptionManager()
let productIds = ["my_sub1", "my_sub2"]
@Published private(set) var availableSubscriptions: [Product]
@Published private(set) var purchasedSubscriptions: [Product] = []
public var userIsSubscribed: Bool {
return !self.purchasedSubscriptions.isEmpty
}
init() {
// Initialize empty products, and then do a product request asynchronously to fill them in.
availableSubscriptions = []
Task {
await updatePurchasedProducts()
}
}
@MainActor
func updatePurchasedProducts() async {
for await result in Transaction.currentEntitlements {
do {
let transaction = try checkVerified(result)
if let subscription = availableSubscriptions.first(where: { $0.id == transaction.productID }) {
purchasedSubscriptions.append(subscription)
}
} catch {
Logger.subscription.error("Error loading users user's purchased products.")
}
}
}
From https://www.apple.com/newsroom/2024/06/introducing-apple-intelligence-for-iphone-ipad-and-mac/:
Powered by Apple Intelligence, Siri becomes more deeply integrated into the system experience. With richer language-understanding capabilities, Siri is more natural, more contextually relevant, and more personal, with the ability to simplify and accelerate everyday tasks.
From https://developer.apple.com/apple-intelligence/:
Siri is more natural, more personal, and more deeply integrated into the system. Apple Intelligence provides Siri with enhanced action capabilities, and developers can take advantage of pre-defined and pre-trained App Intents across a range of domains to not only give Siri the ability to take actions in your app, but to make your app’s actions more discoverable in places like Spotlight, the Shortcuts app, Control Center, and more. SiriKit adopters will benefit from Siri’s enhanced conversational capabilities with no additional work. And with App Entities, Siri can understand content from your app and provide users with information from your app from anywhere in the system.
Based on this, as well as the video at https://developer.apple.com/videos/play/wwdc2024/10133/ , my understanding is that in order for Siri to be able to execute tasks in applications, those applications must implement the Siri Intents API.
Can someone at Apple please clarify: will it be possible for Siri or some other aspect of Apple Intelligence / Core ML / Create ML to take actions in applications which do not support these APIs (e.g. web apps, Citrix apps, legacy apps)?
Thank you!
I am developing an iOS app that supports INPlayMediaIntent.
We are trying to increase the recognition rate of content names, which are song titles, using AppIntentVocabulary.
As a sample, some extracts are shown below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IntentPhrases</key>
<array>
<dict>
<key>IntentName</key>
<string>INPlayMediaIntent</string>
<key>IntentExamples</key>
<array>
<string>Mezamashi Appで湖畔の朝を再生</string>
<string>湖畔の朝をMezamashi Appで再生して</string>
</array>
</dict>
</array>
<key>ParameterVocabularies</key>
<array>
<dict>
<key>ParameterNames</key>
<array>
<string>INPlayMediaIntent.playlistTitle</string>
</array>
<key>ParameterVocabulary</key>
<array>
<dict>
<key>VocabularyItemIdentifier</key>
<string>ID1</string>
<key>VocabularyItemSynonyms</key>
<array>
<dict>
<key>VocabularyItemPronunciation</key>
<string>aogamagaeru</string>
<key>VocabularyItemPhrase</key>
<string>青ガマガエル</string>
</dict>
</array>
</dict>
<dict>
<key>VocabularyItemIdentifier</key>
<string>ID2</string>
<key>VocabularyItemSynonyms</key>
<array>
<dict>
<key>VocabularyItemPronunciation</key>
<string>kohon no asa</string>
<key>VocabularyItemPhrase</key>
<string>湖畔の朝</string>
</dict>
</array>
</dict>
<dict>
<key>VocabularyItemIdentifier</key>
<string>ID3</string>
<key>VocabularyItemSynonyms</key>
<array>
<dict>
<key>VocabularyItemPronunciation</key>
<string>kumageratachi no uta</string>
<key>VocabularyItemPhrase</key>
<string>クマゲラたちの歌</string>
</dict>
</array>
</dict>
</array>
</dict>
</array>
</dict>
</plist>
When running on the iOS 17.5 simulator in Xcode 15.4, the results are as follows.
mediaName = VocabularyItemIdentifier
mediaIdentifier = nil
<INMediaSearch: 0x6000026212c0> {
reference = 0;
mediaType = 0;
sortOrder = 0;
albumName = <null>;
mediaName = ID1;
genreNames = (
);
artistName = <null>;
moodNames = (
);
releaseDate = <null>;
mediaIdentifier = <null>;
}
However, when running on an iOS 17.5 device, the following applies.
mediaName = VocabularyItemPhrase
mediaIdentifier = VocabularyItemIdentifier
<INMediaSearch: 0x301efd9e0> {
reference = 0;
mediaType = 5;
sortOrder = 0;
albumName = <null>;
mediaName = 青ガマガエル;
genreNames = (
);
artistName = <null>;
moodNames = (
);
releaseDate = <null>;
mediaIdentifier = ID1;
}
The results are not stable, for example, sometimes everything else returns null.
I have tried everything, but it is just taking a long time.
Does anyone have any advice on this?
I am trying to make a voip car play app using siri
let assistant = CPAssistantCellConfiguration(position: .top, visibility: .always, assistantAction: .startCall)
let siriTmeplate = CPListTemplate(title: "Siri", sections: [sectionItems, loadingSection], assistantCellConfiguration: assistant)
siriTmeplate.tabSystemItem = .recents
siriTmeplate.showsTabBadge = false
Using the above code gives me the error
"Error: Intent of type INStartCallIntent is not supported for this app category"
on app luanch
I have INStartCallIntent in my apps info plist and I have all the entitlements and I have "business" as the app category,
I can fine 0 help online with this. what does this error really mean and how can I fix it please
iOS 18 adds a specific macro for exposing your search app intent, app entities, etc, to siri but how are you meant to add it to your existing objects without removing it entirely from < iOS 18 users?
For example, i get the following error:
AssistantIntent(schema:) is only available in iOS 18 or newer. Add @available attribute to enclosing struct.
I don't want to do that since i still want to support iOS 17 users with my existing shortcuts. Do i need to duplicate my entire shortcuts model to add the new macro?
Are there going to be any sessions on Image Playgrounds API for iOS?
"Explore machine learning on Apple platforms" mentions the writing and points to sessions, but only mentions Image Playground without pointing to sessions.
After watching the What's new in App Intents session I'm attempting to create an intent conforming to URLRepresentableIntent. The video states that so long as my AppEntity conforms to URLRepresentableEntity I should not have to provide a perform method . My application will be launched automatically and passed the appropriate URL.
This seems to work in that my application is launched and is passed a URL, but the URL is in the form: FeatureEntity/{id}.
Am I missing something, or is there a trick that enables it to pass along the URL specified in the AppEntity itself?
struct MyExampleIntent: OpenIntent, URLRepresentableIntent {
static let title: LocalizedStringResource = "Open Feature"
static var parameterSummary: some ParameterSummary {
Summary("Open \(\.$target)")
}
@Parameter(title: "My feature", description: "The feature to open.")
var target: FeatureEntity
}
struct FeatureEntity: AppEntity {
// ...
}
extension FeatureEntity: URLRepresentableEntity {
static var urlRepresentation: URLRepresentation {
"https://myurl.com/\(.id)"
}
}
The Translation API introduced at Session 10117 is impressive, but limiting it to SwiftUI is restrictive.
This API works great in the demo, but for more complex apps, it lacks flexibility because it is bound to SwiftUI Views.
Please consider making it available in non-SwiftUI environments.
My App has several resources that I'd like to spring open through App Intents. For example a series of Dictionaries. These resources however in the app are behind a log in (for security) and are entitlements that are purchased. They may own 4 of 7 dictionaries.
If I want to have an intent that says, "Open Dictionary: (Dict Name)" how do I best handle situations where the user may no longer be logged in or have the entitlement for that specific dictionary?
Thanks
Hello. Where can I find some examples on creating custom genmojis in Swift and reusing it in an App?
Hellooo,
I’m looking to implement an OpenAI assistant using APIs but I want to do this locally on a group of files.
I want to be able to train a GPT on the contents of a folder for example.
Does anyone have any experience in this?
It seems OpenAI needs a lot of uploading on each request if I were to do this with their API after playing around (but this feels like I’m missing something). It’s also quite costly to use.
I was hoping to use local machine learning and models but this is quite limited in what it can do (eg Lumachain)
Hei Sir is not working in ios beta 18
I consistently receive corrupted results from tf.signal.fft3d() when it is within a function that has a @tf.function decorator. The results are all zero (0.) for entries after a certain x index (see image). Surprisingly, the issue depends on the matrix size. For example, (1023, 1023, 287) works but (1023, 1023, 575) does not. The issue is problematic because it occurs silently and not for all matrix sizes, i.e. can easily slip through tests.
The error occurs only when tensorflow-metal is installed. The Tensorflow version is 2.16.1. My hardware is a Macbook Pro M3 Max with 40 GPU cores, 128 GB RAM running MacOS Sonoma version 14.5 (23F79). A Python environment to reproduce the bug can be created as follows:
conda create --name tfmetalbug python=3.11.9
conda activate tfmetalbug
pip install tensorflow tensorflow-metal
conda install matplotlib
The following code reproduces the issue:
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# Wrap fft3d with tf.function
@tf.function
def fft3d_wrapper_function(x):
return tf.signal.fft3d(x)
# Generate a 3D image
img = tf.random.normal(shape=(1023, 1023, 575), stddev=1., dtype=float) # generate random 3d image
img = tf.dtypes.cast(img, tf.complex64) # convert to complex values
# Compute the 3D FFT
img_fft = fft3d_wrapper_function(img)
# Visualize the 3D FFT
plt.imshow(np.real(img_fft)[:, img_fft.shape[1]//2+10, :], cmap="gray", vmin=-0.001, vmax=0.001)
plt.savefig("fft3d_wrapper_function.png")
For me, removing the @tf.function decorator has resolved the issue.
When in Safari, you can say something like, "Siri, text this link to mom" or "Siri, save this link to reminders" and it will do it with the currently viewed link. Shortcuts also has a "Get what's on screen" action that can be added. How do I expose the user's current context to my App Intent?