Below is the train.Prototxt file that is used to train a pretrained model.
name: \"TempWLDNET\"
layer {
name: \"data\"
type: \"ImageData\
There are differences between your validation step (TEST phase) and the python code you are running:
You are using a different mean file for train and test (!): for phase: TRAIN
you are using mean_file: "mean.binaryproto"
while for phase: TEST
you are using mean_file: "painmean.binaryproto"
. Your python evaluation code uses the training mean file and not the validation.
It is not a good practice to have different settings for train/validation.
Your input images have new_height: 256
and copr_size: 224
. This settings means caffe reads the image, scales it to 256x256
and then crops the center to size 224x224
. Your python code seems to only scale the input to 224x224
without cropping: you feed your net with different inputs.
Please verify that you do not have any other differences between your training prototxt and deploy prototxt.