title: Trouble training VGG16 on CIFAR100 dataset [Keras]
body: <p>I am trying to train <code>VGGNET-16</code> from <code>Keras</code> library on <code>CIFAR-100</code> dataset but validation accuracy and loss are not improving, I think I am doing some mistake while pre-processing the data.</p>
  
  <p>I have tried CIFAR-100 dataset from Keras library but still facing same issue.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>from tensorflow.keras.applications.vgg16 import VGG16
  from tensorflow.keras import optimizers
  from keras.utils import to_categorical
  
  import numpy as np
  import cv2 as cv
  import glob
  import os
  
  
  train_path = r'/content/cifar-100/train'
  test_path  = r'/content/cifar-100/test'
  
  classes = ['class1', 'class2', ...,  'class100']
  
  
  def load_train():
  
      images    = []
      labels    = []
  
      for fields in classes:
  
          index = classes.index(fields)
          path = os.path.join(train_path, fields, '*g')
          files = glob.glob(path)
  
          for fl in files:
  
            # Image
            image = cv.imread(fl)
            images.append(image)
  
            # Label
            label = np.zeros(len(classes))
            label[index] = 1.0
            labels.append(label)
  
      images = np.array(images)
      labels = np.array(labels)
  
      return images, labels
  
  X_train, y_train = load_train()
  
  model = VGG16(weights=None, classes=len(classes), input_shape=(32, 32, 3))
  
  model.compile(loss='categorical_crossentropy', optimizer='sgd', metrics=['accuracy'])
  
  history = model.fit(x=X_train, y=y_train, batch_size=256, epochs=40, verbose=1, validation_split=0.1, shuffle=True)
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>Epoch 1/40
  45000/45000 [==============================] - 16s 357us/sample - loss: 4.5153 - acc: 0.0157 - val_loss: 7.7937 - val_acc: 0.0000e+00
  ...
  Epoch 10/40
  45000/45000 [==============================] - 11s 248us/sample - loss: 3.2936 - acc: 0.1981 - val_loss: 10.8545 - val_acc: 0.0000e+00
  ...
  Epoch 20/40
  45000/45000 [==============================] - 11s 248us/sample - loss: 2.3035 - acc: 0.3951 - val_loss: 13.5597 - val_acc: 0.0000e+00
  ...
  Epoch 30/40
  45000/45000 [==============================] - 11s 248us/sample - loss: 0.7384 - acc: 0.7818 - val_loss: 21.9027 - val_acc: 0.0000e+00
  ...
  Epoch 40/40
  45000/45000 [==============================] - 11s 248us/sample - loss: 0.1570 - acc: 0.9527 - val_loss: 30.7987 - val_acc: 0.0000e+00
  </code></pre>
  
  <p><strong>Data directory</strong></p>
  
  <p><a href="https://i.stack.imgur.com/bjIjb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bjIjb.png" alt="enter image description here"></a></p>
  
  <p>Can anyone please have a look at the code.</p>