2

In tensorflow 2.10.0 I am trying some data augmentation layers, for example:

data_augmentation = keras.Sequential(
    [
        layers.RandomFlip('horizontal'),
        layers.RandomRotation(0.1),#rad
        layers.RandomZoom(0.2)
    ])

#let's look at the manipulated images
plt.figure(figsize=(10,10))
for images, _ in train_dataset.take(1):
    for i in range(9):
        augmented_images = data_augmentation(images)
        ax = plt.subplot(3,3,i+1)
        plt.imshow(augmented_images[0].numpy().astype("uint8"))
        plt.axis("off")

But I get the following warnings.

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 StatelessRandomUniformV2 cause there is no registered converter for this op.
WARNING:tensorflow:Using a while_loop for converting ImageProjectiveTransformV3 cause there is no registered converter for this op.

This is a known issue but the only suggestion I could find suggest to downgrade it.

Also it's long-time known issue as shown in the github repo.

Is there any known solution or alternative to the downgrade?

roschach
  • 8,390
  • 14
  • 74
  • 124

1 Answers1

0

Update Sorry, I didn't see you were asking for the alternative to downgrade. As shown in Apple developer webpage, there is no mention of higher version than 2.9, so I don't know if they've been able to work it.

As advised in apple developer webpage, RngReadAndSkip is registered on the GPU in tensorflow-metal==0.5.1

I upgraded from tensorflow-metal 0.5 to tensorflow-metal 0.5.1 and now it works.

Also, I followed the instructions provided by apple by aligning the versions as per table.

When following instructions provided by apple, I was getting higher tensor flow-macos and tensorflow-metal versions, and I had to downgrade to listed versions on the table.

Releases versions

I also mess around with python version, from 3.10 to 3.8, but not sure that did anything tho.

I hope it helps.

Amra
  • 24,780
  • 27
  • 82
  • 92