K.gradients(loss, input_img)[0] return “None”. (Keras CNN visualization with tensorflow backend)

后端 未结 3 475
猫巷女王i
猫巷女王i 2021-02-03 11:28

I have CNN models trained using Keras with Tensorflow backend. And I want to visualize my CNN filters with this tutorial: https://blog.keras.io/how-convolutional-neural-networks

3条回答
  •  余生分开走
    2021-02-03 11:50

    Below, it's my example. Hope to help someone.

    gradient = keras.backend.gradients(model.output, model.input)[2]

    iterate = keras.backend.function(model.input, [gradient])

    grad = iterate([patches, depthes, poses])

    [patches, depthes, poses] is my model.input

提交回复
热议问题