You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have exactly the same question.. I am using this for regression on video based dataset. So i also want to have the y_true values for each frame of my video. How can i get that from the generator ??
Hello,
Not sure if this is the best way to do it but is working for me (at least until I find it doesn't).
My x_gen var is the generator of my test split.
BATCH_SIZE var is the batch size (obviously) that I used when creating the generator, as an argument.
#Get labels
y_test = []
for x in range(x_gen.__len__()):
#position [1] for labels
batch = x_gen.__getitem__(x)[1]
for y in range(BATCH_SIZE):
y_test.append(batch[y])
#Get labels indices
y_test = np.argmax(y_test, axis=1)
(if there is something wrong, please let me know hehe )
Hope it helps :)
How to get y_true from the generator?
my_generator.classes return only the names of the classes, not the y_true.
The text was updated successfully, but these errors were encountered: