TensorflowTensorflow细节-P158-slim的使用
slim的使用
从以下细节可以看出先使用slim = tf.contrib.slim
要回用,剩下的看看以下代码就懂了
import tensorflow as tf
slim = tf.contrib.slim
with slim.arg_scope([slim.conv2d, slim.max_pool2d, slim.avg_pool2d], stride=1, padding='VALID'):
with tf.variable_scope('Mixed_7c'):
with tf.variable_scope('Branch_0'):
branch_0 = slim.conv2d(net, 320, [1, 1], scope='Conv2d_0a_1x1')