Skip to content

Problem with the code #18

Description

@Diego430

[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions