在tensorboard中查看slim中resnet50的结构

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zjucor/article/details/87929700

tf中的res50实现和Keras,Pytorch都存在差异,可以在tensorboard中方便的看出差异所在

from tensorflow.contrib.slim.nets import resnet_v1
import tensorflow as tf
import tensorflow.contrib.slim as slim

sess = tf.InteractiveSession()

# Create graph
inputs = tf.placeholder(tf.float32, shape=[1, 224, 224, 3])
with slim.arg_scope(resnet_v1.resnet_arg_scope()):
    net, end_points = resnet_v1.resnet_v1_50(inputs, is_training=False)

sess.run(tf.global_variables_initializer())
summary_writer = tf.summary.FileWriter("log", sess.graph)

ref:

https://stackoverflow.com/questions/42572638/how-to-use-the-pre-trained-resnet50-in-tensorflow

https://blog.csdn.net/shwan_ma/article/details/79022674

猜你喜欢

转载自blog.csdn.net/zjucor/article/details/87929700