question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems in training data/test data

See original GitHub issue

Hi, I have an issue with the training data. cvs_to_numpy.py outputs ‘labels_kike.npy’ and ‘data_kike.npy’, where the emotion_recognition.py searches for ‘data_set_fer2013.npy’ and ‘data_labels_fer2013.npy’ while training and cannot find it. Also using poc, I guess it cannot find the image instead of the faces. I get the error message:

AttributeError: 'NoneType' object has no attribute 'shape'

Can you help with these?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9

github_iconTop GitHub Comments

3reactions
sakshamjindal07commented, May 23, 2017

Hi @ghulamsiddiq Do this. Copy constants.py to the data folder. In the copied file, change the CASC_PATH to CASC_PATH = ‘haarcascade_frontalface_default.xml’. Now copy the haarcascade files to the ‘data’ folder which is your working folder presently where cvs_to_numpy.py is placed. This works.

1reaction
RobinManhascommented, May 18, 2017

Steps i took to resolve the issues in training:

  1. Downloaded training set of images from Kaggle

Link: https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge/data

  1. Run the cvs_to_numpy.py script. If you encounter an error like “slicing indices must be Integer or None”, this is because from Python 3.x onwards, int/int gives a float. Just change line 16 to:

gray_border[((150 // 2) - (SIZE_FACE//2))😦(150//2)+(SIZE_FACE//2)), ((150//2)-(SIZE_FACE//2))😦(150//2)+(SIZE_FACE//2))] = image

  1. Once the script ends successfully, 2 files with the name “data_kike.npy” and “labels_kike.npy” will be created. I renamed the “data_kike.npy” to “data_set_fer2013.npy” and “test_set_fer2013.npy”. (Not correct to have same data and test set, but wanted to sanity check the working of scripts). Same for labels. Changing the names and adding these 4 files: data_set_fer2013.npy, test_set_fer2013.npy, data_labels_fer2013.npy, test_labels_fer2013.npy, in the /data/… folder fixes the issues in training data.
Read more comments on GitHub >

github_iconTop Results From Across the Web

The Difference Between Training Data vs. Test ...
In this article, we'll compare training data vs. test data and ... Algorithms enable machines to solve problems based on past observations.
Read more >
Training, Validation and Testing Data Explained
If training and validation data include labels to monitor performance metrics of the model, the testing data should be unlabeled. Test data ......
Read more >
Problems in Machine Learning Models? Check your Data ...
The real problem with insufficient data lies in the fact that with less data, variance increases. Variance, which can easily be defined as...
Read more >
Training Data and Test Data
Training data and test data are two important concepts in machine learning. ... In supervised learning problems, each observation consists of an observed ......
Read more >
Why is it wrong to train and test a model on the same ...
It can happen that the model you train learns "too much" or memorizes the training data, and then it performs poorly on unseen...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found