Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1/Unknown steps while performing fit #23

Open
ZumelzuR opened this issue Mar 23, 2020 · 9 comments
Open

1/Unknown steps while performing fit #23

ZumelzuR opened this issue Mar 23, 2020 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@ZumelzuR
Copy link

Hello, I'm running over google colab and I got stuck on first Epoch for hours using the exlusive GPU of the colab pro.

Using keras_video I got before 
Total data: 4 classes for 91 files for train
Total data: 4 classes for 43 files for validation

Epoch 1/50
      1/Unknown - 7s 7s/step - loss: 1.5134 - acc: 0.2500

So I added the "steps_per_epoch" as 240 to fit method, but after that I got stuck here

Total data: 4 classes for 91 files for train
Total data: 4 classes for 43 files for validation
Epoch 1/50
240/240 [==============================] - ETA: 0s - loss: 1.2376 - acc: 0.4552

Maybe I'm doing something wrong?, I did a quite similar code that your example here with the same shapes
https://medium.com/smileinnovation/training-neural-network-with-image-sequence-an-example-with-video-as-input-c3407f7a0b0f

@ZumelzuR
Copy link
Author

After all I solved by adding also the "validation_steps" parameter to the fit_generator. Maybe this could help somebody in the future :)

@ZumelzuR
Copy link
Author

One more question :) , if you have a unbalanced classes like A-> 10 , B->10, C->20 D->100, can you use the augmenter just for augment the videos of the unbalanced classes?

@metal3d
Copy link
Owner

metal3d commented Mar 24, 2020

Hi,
For the error you mentioned, it is probably a problem of step counter, I didn't have that problem but I will inspect.

For your question, the splitting of validation and test is balanced. e.g for step_val=.3, the generator takes 33% of data in each class.

@metal3d metal3d self-assigned this Mar 24, 2020
@metal3d metal3d added the bug Something isn't working label Mar 24, 2020
@ZumelzuR
Copy link
Author

Thank you!, yes but if I increase 33% each, I will have at the end A->13 , B -> 13, C->26, D-> 133. So at the end my classes will be still unbalanced. But maybe I can just remove some examples from the D class and use the augmenter with 33% for all.

@metal3d
Copy link
Owner

metal3d commented Mar 25, 2020

yes, or maybe I can add a "balance" option to propose several methods.

The problem with unbalanced data is that I cannot guaranty that all classes are represented in validation or test subset if I don't force to pick data in each class.

If you've got an idea, I can try to add that option.

@ZumelzuR
Copy link
Author

Ye sI will take a look in order to try to add that options. Thank you!

@0xPiyush
Copy link

Hi I am facing the exact same problem @metal3d did you find something.

@ZumelzuR
Copy link
Author

ZumelzuR commented Mar 30, 2020

Hi I am facing the exact same problem @metal3d did you find something.

By the moment you have to add to your fit_generator the following options:

steps_per_epoch=number_training_set*NBFRAME//BS,
validation_steps=number_validation_set*NBFRAME//BS


where NBFRAME and BS are the options that you set on the videogenerator library

@metal3d
Copy link
Owner

metal3d commented Apr 10, 2020

OK, you're right, there is something wrong with the length computation. I will try to produce a unit test to reproduce that bug and try to fix as soon as possible.

Thanks a lot for your reporting 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants