davidsandberg / facenet

Face recognition using Tensorflow
MIT License
13.74k stars 4.8k forks source link

error Found array with 0 sample(s) (shape=(0, 512)) while a minimum of 1 is required #1222

Open AlexeyAL1e opened 2 years ago

AlexeyAL1e commented 2 years ago

i am trying to train a neural network on my own dataset and have it classify the test dataset with high accuracy Firstly, I formed my dataset of 30 personalities, each person has 34 face photos. after that i used https://github.com/davidsandberg/facenet/issues/356#issue-238421699 commands to align and get the loss with using script softmax.py Second, I had to run this script to get the .pb file python src/freeze_graph.py .model_dir output_file.pb Thirdly I got a .pkl file using this python src/classifier.py TRAIN ~/datasets/my_dataset/train/ ~/models/model-20170216-091149.pb ~/models/my_classifier.pkl --batch_size 34 Now, I use my model to identify faces in my test dataset, with run script: python src/classifier.py CLASSIFY ~/datasets/my_dataset/test/ ~/models/model-20170216-091149.pb ~/models/my_classifier.pkl --batch_size 34 but I get an error Found array with 0 sample(s) (shape=(0, 512)) while a minimum of 1 is required, it looks like the file .pkl, there are no entries for embedded images Tell me, if these are all points, then what am I doing wrong?

Zhou-Yicheng commented 2 years ago

python src/classifier.py CLASSIFY ~/datasets/my_dataset/test/ ~/models/model-20170216-091149.pb ~/models/my_classifier.pkl --batch_size 34

Change to python src/classifier.py CLASSIFY ~/datasets/my_dataset/train/ ~/models/model-20170216-091149.pb ~/models/my_classifier.pkl --batch_size 34 ?