The code looks generally alright.
However, I’m not sure, if freezing the features will work that well for CIFAR10, as VGG was pretrained on ImageNet, which uses images in the shape [3, 224, 224]. The kernels will thus be adjusted to this resolution and you might need to retrain them.
Could you alternatively try to resize the CIFAR10 images to 224x224 and see, if that yields better results?