I tried to replace the training and validation data with local images. But when running the training code, it came up with the error :
ValueError: Ca
i write the code that change [1,0,0], [0,1,0], [0,0,1] to 0,1,2.
import numpy as np
import tensorflow as tf
def change_to_right(wrong_labels):
right_labels=[]
for x in wrong_labels:
for i in range(0,len(wrong_labels[0])):
if x[i]==1:
right_labels.append(i)
return right_labels
wrong_labels =np.array([[0,0,1,0], [0,0,1,0], [1,0,0,0],[0,1,0,0]])
right_labels =tf.convert_to_tensor(np.array(change_to_right(wrong_labels)))