代码场景:
linux系统
在facenet训练自己的数据集
运行train_softmax.py时出现错误
问题描述
AssertionError: The number of LFW images must be an integer multiple of the LFW batch size
数据集的图片必须与batch_size成倍数
原因分析:
源代码设置的batch_size=100,如果要训练自己的数据集,需要将数据集的样本数设置为100的倍数
解决方案:
打印出了一下参数:
nrof_image
batch_size
pairs[nrof_skipped_pairs]
原因是nrof_image:398与batch_size100不能整除
而nrof_image=len(actual_issame) * 2 它与actual_issame有关
而actual_issame=199
而actual_issame与pairs.txt有关
发现有图片没有读取到,跳过了
找到pairs中的那一个参量
然后重新生成一个新的pairs解决问题