Created
June 6, 2018 10:45
-
-
Save funwarioisii/c0f3228f576ac5f92ddc97f1beb4c67a to your computer and use it in GitHub Desktop.
tf.summary.imageのやり方を忘れがちなのでメモしておく
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
def cnn(image): | |
with tf.name_scope('conv1'): | |
W_conv1 = tf.nn.conv2d(image, weight, strides=[1, 1, 1, 1], padding='SAME') | |
w_conv1 = tf.transpose(tf.reshape(W_conv1, [-1, 224, 224, 3]), perm=[3, 0, 1, 2]) # 可視化用 | |
with tf.device('/cpu:0'): # どこかでtf.device('/gpu:2')などしてると落ちるので | |
tf.summary.image('filter', w_conv1, 10) | |
return y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment