Tensorflow freeze model but backpropagate error and update input layer
I try to explain my goal. With a trained model I want to select the output class and update the feeded image.
Some hint?
You can use tf.gradients
to back propagate to the input layer:
...
logits = run_net(image)
g = tf.gradients(logits[target_class], image)
image += g[0] * step
...
Good examples of doing this can be found in the Deep Dream demo code (see for example "Naive feature visualization" or "Multiscale image generation."
链接地址: http://www.djcxy.com/p/32062.html上一篇: 调用全局时出错