我已经完成了训练过程,并获得了.hdf5格式的模型
我使用的神经网络是暹罗卷积神经网络。
验证时,预测的图像是来自我的测试文件夹的随机图像。 我在测试时使用
test_alphabets = glob('{}/TEST/*'.format(dataset_dirname))
testset={}
for alph in test_alphabets:
dirs = glob('{}/*'.format(alph))
alphabet = {}
for dirname in dirs:
alphabet[dirname] = glob('{}/*'.format(dirname))
testset[alph] = alphabet
然后,使用
显示结果display_validation_test(siamese_model1, testset)
答案 0 :(得分:0)
model.load_weights('your_weight_file.h5')
加载权重prediction = model.predict(images)