Example #1
0
 def build_network():
     network = resnet_model.resnet_v1(
         resnet_depth=params['resnet_depth'],
         num_classes=params['num_label_classes'],
         dropblock_size=params['dropblock_size'],
         dropblock_keep_probs=dropblock_keep_probs,
         data_format=params['data_format'])
     return network(inputs=features,
                    is_training=(mode == tf.estimator.ModeKeys.TRAIN))
Example #2
0
  def test_load_resnet18(self):
    network = resnet_model.resnet_v1(
        resnet_depth=18, num_classes=10, data_format='channels_last')
    input_bhw3 = tf.placeholder(tf.float32, [1, 28, 28, 3])
    resnet_output = network(inputs=input_bhw3, is_training=True)

    sess = tf.Session()
    sess.run(tf.global_variables_initializer())
    _ = sess.run(
        resnet_output, feed_dict={input_bhw3: np.random.randn(1, 28, 28, 3)})