Enlarge a tensor in tensorflow

后端 未结 2 1035
面向向阳花
面向向阳花 2021-01-21 14:00

I\'m searching for a tensorflow python method to enlarge (resize) a tensor to double every element in each feature map along both axis e.g.:



        
2条回答
  •  再見小時候
    2021-01-21 14:21

    Just use tf.image.ResizeMethod with Nearest Neighbor interpolation

    array = tf.image.resize_images(old_array, (old_size*2, old_size*2),
                                   method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
    

    Input to the method must be 4-D Tensor of shape [batch, height, width, channels] or 3-D Tensor of shape [height, width, channels].

    https://www.tensorflow.org/api_docs/python/tf/image/resize

提交回复
热议问题