[英][Apple M1]: I got No registered 'RngReadAndSkip' OpKernel for 'GPU' devices compatible with node {{node RngReadAndSkip}} . Registered: device='CPU'
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'
It happens because some TF/Keras high-level methods are not implemented in tensorflow-metal.发生这种情况是因为某些 TF/Keras 高级方法没有在 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).接下来你可以正常做其他事情(使用 GPU)。
Hope, Apple will fix it someday (and their another tons of bugs too, lmao)希望苹果有一天会修复它(还有他们的另一吨错误,lmao)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.