Dec-07-2023, 05:57 PM
Hello! I am trying to run the code from this tutorial: link-for-the-code
but on this part:
but on this part:
val_image_batch, val_label_batch = next(iter(valid_generator)) tf_model_predictions = model.predict(val_image_batch) print("Prediction results shape:", tf_model_predictions.shape) plt.figure(figsize=(10,9)) plt.subplots_adjust(hspace=0.5) for n in range((len(predicted_labels)-2)): # here is the problem plt.subplot(6,5,n+1) plt.imshow(val_image_batch[n]) color = "green" if predicted_ids[n] == true_label_ids[n] else "red" plt.title(predicted_labels[n].title(), color=color) plt.axis('off') _ = plt.suptitle("Model predictions (green: correct, red: incorrect)")I get this error:
Error:NameError: name 'predicted_labels' is not defined
I am searching all day in order to find a solution via google...Nothing yet!! Has anyone, any idea how to solve it?