import tensorflow as tf

                             [batch_size, num_classes])
        pre_pool = end_points['Conv2d_13_pointwise']
        self.assertListEqual(pre_pool.get_shape().as_list(),
                             [batch_size, 4, 4, 1024])

    def testUnknownImageShape(self):
        tf.reset_default_graph()
        batch_size = 2
        height, width = 224, 224
        num_classes = 1000
        input_np = np.random.uniform(0, 1, (batch_size, height, width, 3))
        with self.test_session() as sess:
            inputs = tf.placeholder(tf.float32, shape=(batch_size, None, None, 3))
            logits, end_points = mobilenet_v1.mobilenet_v1(inputs, num_classes)
            self.assertTrue(logits.op.name.startswith('MobilenetV1/Logits'))
            self.assertListEqual(logits.get_shape().as_list(),
                                 [batch_size, num_classes])
            pre_pool = end_points['Conv2d_13_pointwise']
            feed_dict = {inputs: input_np}
            tf.global_variables_initializer().run()
            pre_pool_out = sess.run(pre_pool, feed_dict=feed_dict)
            self.assertListEqual(list(pre_pool_out.shape), [batch_size, 7, 7, 1024])

    def testGlobalPoolUnknownImageShape(self):
