Posts

Post not yet marked as solved
3 Replies
1.5k Views
I am trying to train an image classification network in Keras with tensorflow-metal. The training freezes after the first 2-3 epochs if image augmentation layers are used (RandomFlip, RandomContrast, RandomBrightness) The system appears to use both GPU as well as CPU (as indicated by Activity Monitor). Also, warnings appear both in Jupyter and Terminal (see below). When the image augmentation layers are removed (i.e. we only rebuild the head and feed images from disk), CPU appears to be idle, no warnings appear, and training completes successfully. Versions: python 3.8, tensorflow-macos 2.11.0, tensorflow-metal 0.7.1 Sample code: img_augmentation = Sequential( [ layers.RandomFlip(), layers.RandomBrightness(factor=0.2), layers.RandomContrast(factor=0.2) ], name="img_augmentation", ) inputs = layers.Input(shape=(384, 384, 3)) x = img_augmentation(inputs) model = tf.keras.applications.EfficientNetV2S(include_top=False, input_tensor=x, weights='imagenet') model.trainable = False x = tf.keras.layers.GlobalAveragePooling2D(name="avg_pool")(model.output) x = tf.keras.layers.BatchNormalization()(x) top_dropout_rate = 0.2 x = tf.keras.layers.Dropout(top_dropout_rate, name="top_dropout")(x) outputs = tf.keras.layers.Dense(179, activation="softmax", name="pred")(x) newModel = Model(inputs=model.input, outputs=outputs, name="EfficientNet_DF20M_species") reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_accuracy', factor=0.9, patience=2, verbose=1, min_lr=0.000001) optimizer = tf.keras.optimizers.legacy.SGD(learning_rate=0.01, momentum=0.9) newModel.compile(optimizer=optimizer, loss='categorical_crossentropy', metrics=['accuracy']) history = newModel.fit(x=train_ds, validation_data=val_ds, epochs=30, verbose=2, callbacks=[reduce_lr]) During training with image augmentation, Jupyter prints the following warnings while training the first epoch: WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting RngReadAndSkip cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting Bitcast cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomUniformFullIntV2 cause there is no registered converter for this op. WARNING:tensorflow:Using a while_loop for converting StatelessRandomGetKeyCounter cause there is no registered converter for this op. ... During training with image augmentation, Terminal keeps spamming the following warning: 2023-02-21 23:13:38.958633: I metal_plugin/src/kernels/stateless_random_op.cc:282] Note the GPU implementation does not produce the same series as CPU implementation. 2023-02-21 23:13:38.958920: I metal_plugin/src/kernels/stateless_random_op.cc:282] Note the GPU implementation does not produce the same series as CPU implementation. 2023-02-21 23:13:38.959071: I metal_plugin/src/kernels/stateless_random_op.cc:282] Note the GPU implementation does not produce the same series as CPU implementation. 2023-02-21 23:13:38.959115: I metal_plugin/src/kernels/stateless_random_op.cc:282] Note the GPU implementation does not produce the same series as CPU implementation. 2023-02-21 23:13:38.959359: I metal_plugin/src/kernels/stateless_random_op.cc:282] Note the GPU implementation does not produce the same series as CPU implementation. ... Any suggestions?
Posted
by Cardu6lis.
Last updated
.
Post not yet marked as solved
0 Replies
560 Views
I have a SwiftUI app that uses Core Data and CloudKit. Using the Xcode 15 beta and iOS17 beta simulator, some of the runs cause the app to crash on startup. The console prints the following: BUG IN CLIENT OF CLOUDKIT: Not entitled to listen to push notifications. Please add the 'aps-connection-initiate' entitlement. Push notifications are added correctly and everything works on iOS16 and earlier. This crash also only occurs in about 20% runs on iOS17 beta. Any tips on how to resolve this?
Posted
by Cardu6lis.
Last updated
.
Post not yet marked as solved
1 Replies
989 Views
I'm trying to train an image classification model in CreateML application using the DF20 dataset from https://sites.google.com/view/danish-fungi-dataset?pli=1 When I tap on Train, the application begins to extract the necessary data. This process ends after the first cca 30 000 images. The footer shows Unexpected error and (strangely) a new window opens to Create New Project. No further info about the error is provided anywhere. The training succeeds when using a smaller portion of the dataset (<20 000 images). Anything over 40 000 images results in this error. Any ideas?
Posted
by Cardu6lis.
Last updated
.
Post not yet marked as solved
1 Replies
823 Views
Let's say I would like to build a classification model to recognise plants. Two plants may look identical but differ by region or month of growth, so I would like to build a multi-input model that accepts not only an image, but also additional metadata, such as the month and location where the photo was taken. Inputs: imageOfPlant: Image month: Double latitude: Double longitude: Double Output: speciesName: [String] // sorted by probability, like default image classification Can this be done in CreateML, or using Apple frameworks in general?
Posted
by Cardu6lis.
Last updated
.
Post marked as solved
7 Replies
2.7k Views
In the summer, Apple published an informative sample app on sharing objects between iCloud users using Core Data, CloudKit and UICloudSharingController in SwiftUI: https://developer.apple.com/documentation/coredata/sharing_core_data_objects_between_icloud_users However, Apple also announced the new Collaboration features for Messages in iOS16. Now, it seems Collaboration is incompatible with UICloudSharingController and the sharing sheet it invokes, on iOS16. MRE: See the Apple sample app linked above. Reproduction: Create new share, Manage share with UICloudSharingController, Share With More People, Share using Messages (may succeed first time but fails on subsequent attempts on iOS16. Works great on iOS15). Expectation: We can use UICloudSharingController to add new participants, using Messages, Mail or other platforms. The link will display correctly on all devices. Reality: On iOS16+, attempting to share via Messages engages the "Collaboration" framework and leads to an alert: "An Error Occurred. Unable to start collaboration" (see Image 1). Triggering this error breaks ANY further shares - the link now cannot be created for Mail and other platforms either (see Image 2). Furthermore, if the first attempt succeeds, the link does not appear correctly on the receiving device (see Image 3). The link appears correctly when sent from a device running iOS15. Question: How can this be resolved, so that we can share CloudKit records between users using Messages in iOS16+? Images: https://imgur.com/a/o1fdABT
Posted
by Cardu6lis.
Last updated
.
Post marked as solved
1 Replies
1.6k Views
I have an iOS app with an independent watchOS app. With Xcode 14, I migrated the project to only use a single target for watchOS (i.e. remove the "extension" target). Everything builds, but I get the following build warning: appName.app is a Foundation extension and must be embedded in the parent app bundle's PlugIns directory, but is embedded in the parent app bundle's Watch directory. where "appName" is the product name of the watchOS target. I tried the following, to no avail: restart Xcode restart computer clean build folder delete derived data Any ideas?
Posted
by Cardu6lis.
Last updated
.
Post marked as solved
1 Replies
804 Views
My submission was rejected because I submitted a duplicate or identical promotional images for different promoted in-app purchase products. I was directed by Apple to edit the in-app purchases. However, editing the in-app purchases is disabled with the following message: “At least one of your in-app purchases is associated with a version of an app that's not yet approved. Until this version is approved, you can't submit any changes for review.” I tried the following to enable editing of the in-app purchases: Cancel review submission Submit a new build Submit a new version Reply to the Apple rejection. They referred me to App Store Connect Help documentation, which does not contain information about this issue. None of the above approaches worked, and I remain unable to edit in-app purchasees in App Store Connect. But I need to be able to edit in-app purchases to fix the underlying issue. Please advise?
Posted
by Cardu6lis.
Last updated
.