Comments (9)
Hi,
It looks like there are too few images in the validation set.
The function "sample_people" tries to sample 45 persons with 40 images per person. But if some of the classes in the dataset contains less than 40 images more classes will be used to get 45*40 images.
One way to solve it would be to use a smaller "train_set_fraction", e.g. 0.8 or something. Then the validation set will be larger. Another (ugly) way could be to change the seed. Then a different set of classes will be included in the validation set, and perhaps these classes together will have enough images for validation.
from facenet.
@davidsandberg I put --lfw_dir place empty as i don't want to see the validation accuracy. Then also I am getting the error as below,
Traceback (most recent call last):
File "src/train_tripletloss.py", line 486, in
main(parse_arguments(sys.argv[1:]))
File "src/train_tripletloss.py", line 186, in main
args.embedding_size, anchor, positive, negative, triplet_loss)
File "src/train_tripletloss.py", line 212, in train
image_paths, num_per_class = sample_people(dataset, args.people_per_batch, args.images_per_person)
File "src/train_tripletloss.py", line 327, in sample_people
class_index = class_indices[i]
IndexError: index 4 is out of bounds for axis 0 with size 4
from facenet.
Can I reduce 40 images/person? What is the impact of doing this?
Thanks
On Thu, May 19, 2016 at 10:56 PM, David Sandberg [email protected]
wrote:
Hi,
It looks like there are too few images in the validation set.
The function "sample_people" tries to sample 45 persons with 40 images per
person. But if some of the classes in the dataset contains less than 40
images more classes will be used to get 45*40 images.
One way to solve it would be to use a smaller "train_set_fraction", e.g.
0.8 or something. Then the validation set will be larger. Another (ugly)
way could be to change the seed. Then a different set of classes will be
included in the validation set, and perhaps these classes together will
have enough images for validation.—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#18 (comment)
from facenet.
Yes, reducing either the number of images per person or the number of people would help to solve the problem. But i'm not sure how it will affect the training. Also, you need to make sure that you can get a whole number of batches, i.e. that people_per_batch*images_per_person = batch_size * n, where n is an integer.
from facenet.
Also making sure the batch_size and people_per_batch are multiples of 3 helps.
from facenet.
@PoonamZ @davidsandberg any findings for the above error, I am getting the same error, Thanks in advance. I have training set of 21 images each class
from facenet.
@KumailHussain I didn't get any solution for this.
from facenet.
Hi, I am using "train_tripletloss.py" as training algorithm, but every time I try to run it, I get the error below and
I can't find any solution for that, please help me. Thank you in advance.
Restoring pretrained model: ./models/20170512-110547/model-20170512-110547.ckpt-250000
Traceback (most recent call last):
File "train_tripletloss.py", line 493, in
main(parse_arguments(sys.argv[1:]))
File "train_tripletloss.py", line 192, in main
args.embedding_size, anchor, positive, negative, triplet_loss)
File "train_tripletloss.py", line 218, in train
image_paths, num_per_class = sample_people(dataset, args.people_per_batch, args.images_per_person)
File "train_tripletloss.py", line 333, in sample_people
class_index = class_indices[i]
IndexError: index 2 is out of bounds for axis 0 with size 2
from facenet.
@sassiaicha , was facing the same error during training. Same Index error. Looks like you have chosen only 2 classes which is causing the problem.
I myself was using only 10 custom classes with 3 images for each. But when I increased my dataset (used LFW dataset for training), the code ran for training. Maybe try increasing your dataset.
from facenet.
Related Issues (20)
- command not found error (while trying align the LFW dataset)
- ValueError: Node 'gradients/InceptionResnetV1/Bottleneck/BatchNorm/cond/FusedBatchNorm_1_grad/FusedBatchNormGrad' has an _output_shapes attribute inconsistent with the GraphDef for output #3: Dimension 0 in both shapes must be equal, but are 0 and 512. Shapes are [0] and [512]. HOT 4
- TypeError: true_fn and false_fn arguments to tf.cond must have the same number, type, and overall structure of return values
- does facenet support docker HOT 1
- About tensorflow -v2.8.0, I have a error. HOT 1
- Validation loss
- ve
- How to make inference on a single image? HOT 1
- Bounding box is inaccurate HOT 2
- Error in Loading checkpoint file for facenet512
- Unable to open file (file signature not found) HOT 1
- CASIA Webface Dataset Link Needs Updating
- Incorrect bounding box
- Issue with Tensor Names in DeepSORT Integration with FaceNET Model
- Unable to use .pb in tensorflow's java api
- Unable to convert onnx model to TRT model
- ValueError: Node 'gradients/InceptionResnetV1/Bottleneck/BatchNorm/cond/FusedBatchNorm_1_grad/FusedBatchNormGrad' has an _output_shapes attribute inconsistent with the GraphDef for output #3: Dimension 0 in both shapes must be equal, but are 0 and 512. Shapes are [0] and [512]. HOT 1
- Request for Weight Files in faceswap-GAN Project
- How to add visualization to train_tripletloss.py
- Find
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facenet.