isseu / emotion-recognition-neural-networks

Emotion recognition using DNN with tensorflow
MIT License
835 stars 308 forks source link

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

Open sakshamjindal07 opened 7 years ago

sakshamjindal07 commented 7 years ago

Downloaded the dataset but still facing the Error : "AttributeError: 'NoneType' object has no attribute 'shape' "

timonsku commented 7 years ago

Having the same issue here. How did you solve this @sakshamjindal07 ?

sakshamjindal07 commented 7 years ago

@PTS93, this issue comes up because your code POC.py does not recognise the captured frame. Tweak the code a little bit to see if it recognises the image or not. Remind me in 2 days, I will let you know. I am travelling right now.

RBirkeland commented 7 years ago

@sakshamjindal07 Hey, could you please share your solution, I'm also facing the same issue. I've rewritten the manual_poc.py file to take a dir path as a parameter and use that for predicting. Some images work, but some throw this error.##

EDIT: I've solved the issue. In my case it was a complete path issue. Make sure that the line files.append(f) in manual_poc.py adds the full path. For me I manually added the directory structure to the file files.append(str(path) + f)

SeptBlast commented 7 years ago

@sakshamjindal07 and @RBirkeland you both are missing out few basic elements to be kept while fetching data to train a machine that's why you are facing this error again and again.

Hint: Define Attributes and the frame according to your training Data you had downloaded from Keggler. POC.py needs to be edited according to the raw training data.

Ipvikukiepki-KQS commented 6 years ago

I hope that this information might be useful. This error occurs possibly under two conditions, either cv2.imread() or else cv2.video_capture() In case of error due to cv2.imread(), specify the path file of an Image for which poc must be shown. 'None' is returned as there are no image. I have solved this issue by this method.