vgg_network.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:texture-networks 作者: ProofByConstruction 项目源码 文件源码
def __init__(self, name, input, i, j, k):
        """
        :param input: A 4D-tensor of shape [batchSize, 224, 224, 3]
                [0:i, :, :, :] holds i style images,
                [i:i+j, :, :, :] holds j content images,
                [i+j:i+j+k, :, :, :] holds k synthesized images
        """
        self.name = name
        self.num_style = i
        self.num_content = j
        self.num_synthesized = k
        with open("models/vgg16.tfmodel", mode='rb') as f:
            file_content = f.read()
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(file_content)
        tf.import_graph_def(graph_def, input_map={"images": input}, name=self.name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号