oarriaga / face_classification

Real-time face detection and emotion/gender classification using fer2013/imdb datasets with a keras CNN model and openCV.
MIT License
5.61k stars 1.59k forks source link

image_gradcam_demo.py #76

Open doublezsx opened 6 years ago

doublezsx commented 6 years ago

Traceback (most recent call last): File "D:/my_face/face_classification-master/src/image_gradcam_demo.py", line 74, in predicted_class, 'conv2d_7') File "D:\my_face\face_classification-master\src\utils\grad_cam.py", line 116, in compile_gradient_function gradients = normalize(K.gradients(loss, conv_output)[0]) File "D:\my_face\face_classification-master\src\utils\grad_cam.py", line 31, in normalize return x / (K.sqrt(K.mean(K.square(x))) + 1e-5) File "C:\Program Files\Python36\lib\site-packages\keras\backend\tensorflow_backend.py", line 1435, in square return tf.square(x) File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\ops\math_ops.py", line 470, in square return gen_math_ops.square(x, name=name) File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 8379, in square "Square", x=x, name=name) File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 528, in _apply_op_helper (input_name, err)) ValueError: Tried to convert 'x' to a tensor and failed. Error: None values not supported.

Tony1Q84 commented 6 years ago

Hi, I also met this problem, have you solved this? Could you please tell me how to solve it

DBarthe commented 5 years ago

Hi, same problem happening to me.

RiseljeVoliMacke commented 5 years ago

Hey, it can be solved following this - https://github.com/oarriaga/face_classification/issues/62 .

iamzhangyunlu commented 5 years ago

When run image_gradcam_demo.py, I got this problem: OSError: cannot identify image file '/Users/zhangyunlu/PycharmProjects/untitled28/face_classification-master/src/image_gradcam_demo.py'

please tell me what's wrong with that?