[Apple M1]: I got No registered 'RngReadAndSkip' OpKernel for 'GPU' devices compatible with node {{node RngReadAndSkip}} . Registered: device='CPU'

Viewed 1600

this is my code

random = tf.random.Generator.from_seed(42)
random = random.normal(shape=(2,2))

but i got this error:

tensorflow.python.framework.errors_impl.NotFoundError: No registered 'RngReadAndSkip' 
OpKernel for 'GPU' devices compatible with node {{node RngReadAndSkip}}. Registered: device='CPU'
1 Answers

It happens because some TF/Keras high-level methods are not implemented in tensorflow-metal. You can try this workaround:

with tf.device('/cpu:0'):
    ...  # your code which need RngReadAndSkip low-level method here

And next you can do other stuff normally (with GPU).

Hope, Apple will fix it someday (and their another tons of bugs too, lmao)

Related