GithubHelp home page GithubHelp logo

training error about facenet HOT 9 CLOSED

davidsandberg avatar davidsandberg commented on April 30, 2024
training error

from facenet.

Comments (9)

davidsandberg avatar davidsandberg commented on April 30, 2024 1

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.

PoonamZ avatar PoonamZ commented on April 30, 2024 1

@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.

kaishijeng avatar kaishijeng commented on April 30, 2024

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.

davidsandberg avatar davidsandberg commented on April 30, 2024

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.

Shubhamcl avatar Shubhamcl commented on April 30, 2024

Also making sure the batch_size and people_per_batch are multiples of 3 helps.

from facenet.

KumailHussain avatar KumailHussain commented on April 30, 2024

@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.

PoonamZ avatar PoonamZ commented on April 30, 2024

@KumailHussain I didn't get any solution for this.

from facenet.

sassiaicha avatar sassiaicha commented on April 30, 2024

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.

RohanMathur17 avatar RohanMathur17 commented on April 30, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.