Hello:
I’m practicing tensorflow tutorial :Video classification with a 3D convolutional neural network, the code:
def get_actual_predicted_labels(dataset):
actual = [labels for _, label in dataset.unbatch()]
predicted = model.predict(dataset)
actual = tf.stack(actual, axis=0)
predicted = tf.concat(predicted, axis=0)
predicted = tf.argmax(predicted, axis=1)
return actual, predicted
fg = FrameGenerator(subset_paths[‘train’], n_frames, training=True)
labels = list(fg.class_ids_for_name.keys())
actual, predicted = get_actual_predicted_labels(train_ds)
it’s all OK on the above,
cm = tf.math.confusion_matrix(actual, predicted)
The error:
UnimplementedError: {{function_node _wrapped__Cast_device/job:localhost/replica:0/task:0/device:CPU:0}} Cast string to int64 is not supported [Op:Cast]
Has someone can help me? Thank you very much.