-
Notifications
You must be signed in to change notification settings - Fork 97
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
Problem with the code #18
Comments
Hello! I have solved this problem as follows: |
@leileileidan You should create a pull request for this. |
This fixed another issue for me where I was getting incorrect results for the final prediction. Thanks! |
[3 1 1 0 1 2 1 3 3 0 1 2 2 1 1 1 1 3 2 0 3 0 1 1 1 1 1 2 1 3 1 0 1 3 0 0 3
3 1 0 1 0 1 2 0 3 3 3 0 0 3 1 1 1 0 1 0 3 3 0 3 3 3 1 2 0 0 0]
(0, 0, 0, 0, 1, 0, 0, 3, 3, 0, 2, 0, 2, 0, 0, 0, 2, 3, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 0, 3, 0, 0, 3, 3, 1, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 0, 1, 2, 1, 0, 1, 0, 3, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0)
Accuracy:0.574
Confusion matrix: [[18 0 0 0]
[14 7 3 1]
[ 6 0 1 0]
[ 5 0 0 13]]
Traceback (most recent call last):
File "emotionRecognition_cnn.py", line 63, in
cnn_example()
File "emotionRecognition_cnn.py", line 33, in cnn_example
predicted = cnn.predict_one(feature)
File "/home/diego/Desktop/progetto/cnn_emotionrecognition/dnn.py", line 98, in predict_one
return np.argmax(self.model.predict(np.array([sample])))
File "/home/diego/.local/lib/python3.7/site-packages/keras/engine/training.py", line 1149, in predict
x, _, _ = self._standardize_user_data(x)
File "/home/diego/.local/lib/python3.7/site-packages/keras/engine/training.py", line 751, in _standardize_user_data
exception_prefix='input')
File "/home/diego/.local/lib/python3.7/site-packages/keras/engine/training_utils.py", line 128, in standardize_input_data
'with shape ' + str(data_shape))
ValueError: Error when checking input: expected conv2d_1_input to have 4 dimensions, but got array with shape (1, 198, 39)
The code used is:
python3 cnn_examples.py
The envinronment is created via "pip3 install -r requirements.txt" as you suggested
I don't know what this problem is, can you help me?
Thanks
The text was updated successfully, but these errors were encountered: