hi
Finally I can run those 7 lines of simple vgg code to build a model for cat and dog data well in windows platform(Theano+CPU+win7 64bit OS).
Its accuracy is 0.97 on train data as expected. based on that, i save this final weights to a h5 file.
Now I’d like to predict the classification on test data using this model&weights. Its code is below.
from future import division,print_function
import os, json
from glob import glob
import numpy as np
np.set_printoptions(precision=4, linewidth=100)
from matplotlib import pyplot as plt
import utils; reload(utils)
from utils import plots
path = "D:\work\sw_tool\Anaconda3\practice\dogscats\"
batch_size = 4
from vgg16 import Vgg16
vgg = Vgg16()
vgg.model.load_weights(path+‘finetune_dog_cat.h5’)
batches, preds = vgg.test(path+‘test1’)
print(preds[:7])
But it fails as below. I know it’s caused by get_batches in vgg.test(…), but don’t know why? BTW, I’m sure its path and batch_size are all right. can anyone help it? thanks.