Recently I bought a new Macbook Air M1 2020 and followed the instructions to install the tensorflow-macos and tensorflow-metal.
Then I tried to work out the tensorflow NLP example
https://www.tensorflow.org/text/tutorials/text_classification_rnn
to create a model
model = tf.keras.Sequential([
encoder,
tf.keras.layers.Embedding(
input_dim=len(encoder.get_vocabulary()),
output_dim=64,
# Use masking to handle the variable sequence lengths
mask_zero=True),
tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(64)),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(1)
])
but it failed to fit the on the first layer of the RNN
Registered kernels:
<no registered kernels>
[[cond_41/then/_0/cond/CudnnRNNV3]]
[[sequential/bidirectional/forward_gru/PartitionedCall]]
[[gradient_tape/sequential/embedding/embedding_lookup/Reshape/_60]]
(1) Invalid argument: No OpKernel was registered to support Op 'CudnnRNNV3' used by {{node cond_41/then/_0/cond/CudnnRNNV3}} with these attrs: [seed=0, dropout=0, T=DT_FLOAT, input_mode="linear_input", direction="unidirectional", rnn_mode="gru", seed2=0, is_training=true, num_proj=0, time_major=false]
Registered devices: [CPU, GPU]
Registered kernels:
<no registered kernels>
[[cond_41/then/_0/cond/CudnnRNNV3]]
[[sequential/bidirectional/forward_gru/PartitionedCall]]
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_15394]
The related tensorflow versions are as follows
tensorflow-datasets==4.3.0
tensorflow-estimator==2.5.0
tensorflow-macos==2.5.0
tensorflow-metadata==1.1.0
tensorflow-metal==0.1.1
For further details, attached please find the full package requirements in the environment.