Closed visualturbo closed 2 years ago
@visualturbo logits_size=[32,5] labels_size=[32,4]
seems to be you have 5 classes in datasets but only 4 classes in labels file.
Can you please share colab or data set to reproduce the issue. Thanks!
@hjonnala
Many thanks :) Yes i'm use only 4 label and find the problem change units number to 4.
model = tf.keras.Sequential([ base_model, tf.keras.layers.Conv2D(filters=32, kernel_size=3, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.GlobalAveragePooling2D(), tf.keras.layers.Dense(units=4, activation='softmax') ])
Thanks Your help. Regards
Hi,
Retreained the model on flower dataset working greate when i train my custom dataset 4200 jpg resized to 224x224px. Tested another size but this is the error always in my dataset on Google Colab.
IMAGE_SIZE = 224 BATCH_SIZE = 64
datagen = tf.keras.preprocessing.image.ImageDataGenerator( rescale=1./255, validation_split=0.2)
train_generator = datagen.flow_from_directory( flowers_dir, target_size=(IMAGE_SIZE, IMAGE_SIZE), batch_size=BATCH_SIZE, subset='training')
val_generator = datagen.flow_from_directory( flowers_dir, target_size=(IMAGE_SIZE, IMAGE_SIZE), batch_size=BATCH_SIZE, subset='validation')
Whats wrong? Can help me?
Epoch 1/10
InvalidArgumentError Traceback (most recent call last)