amineHorseman / facial-expression-recognition-using-cnn

Deep facial expressions recognition using Opencv and Tensorflow. Recognizing facial expressions from images or camera stream
GNU General Public License v3.0
445 stars 141 forks source link

about zerodivisionerror #18

Open JasonYorkPig opened 5 years ago

JasonYorkPig commented 5 years ago

hello amine! I tried to train 5 emotions with using landmarks. the train environment is like this:

and I also changed [output_size=5] in parameters.py. but when I tried to train,

Traceback (most recent call last): File "train.py", line 124, in train() File "train.py", line 60, in train n_epoch=TRAINING.epochs) File "/anaconda3/envs/tf/lib/python3.6/site-packages/tflearn/models/dnn.py", line 216, in fit callbacks=callbacks) File "/anaconda3/envs/tf/lib/python3.6/site-packages/tflearn/helpers/trainer.py", line 339, in fit show_metric) File "/anaconda3/envs/tf/lib/python3.6/site-packages/tflearn/helpers/trainer.py", line 847, in _train e = evaluate_flow(self.session, eval_ops, self.test_dflow) File "/anaconda3/envs/tf/lib/python3.6/site-packages/tflearn/helpers/trainer.py", line 1003, in evaluate_flow res = [r / dataflow.n_samples for r in res] File "/anaconda3/envs/tf/lib/python3.6/site-packages/tflearn/helpers/trainer.py", line 1003, in res = [r / dataflow.n_samples for r in res] ZeroDivisionError: float division by zero

Is there anything else that needs to be fixed? :)

amineHorseman commented 5 years ago

Can you add a print statement before line 55 to check the size of data['X'], data['X2'] and data['Y']?

JasonYorkPig commented 5 years ago

What I found was that when I specify the emotions, skip two or more label numbers(0,2,4) then the ZeroDivisionError was happened.

LauraKag commented 4 years ago

I have the exact same issue...how can I fix it?