在预训练的 inception3 模型中尝试访问 pool3 激活时如何利用批处理
How do I take advantage of batching when trying to access pool3 activations in the pre-trained inception3 model
我目前可以做到以下几点:
pool3 = sess.graph.get_tensor_by_name('pool_3:0')
pool3_features = sess.run(pool3,{'DecodeJpeg/contents:0': data})
其中数据是单个图像的二进制流
data = gfile.FastGFile(img_name, 'rb').read()
我可以将它们堆叠起来,而不是单独传递每个图像流吗?如果图像的大小都不同怎么办? op graph如何处理不同尺寸的图片?
DecodeJpeg 一次只能加载一个图像。您可以在此处查看图像加载后对图像应用 resize_bilinear 操作的一些示例:
将多个图像调整为匹配尺寸后,您可以使用 expand_dims 将它们扩展为 4D,然后沿着批次维度将它们连接在一起以获得批次。
我目前可以做到以下几点:
pool3 = sess.graph.get_tensor_by_name('pool_3:0')
pool3_features = sess.run(pool3,{'DecodeJpeg/contents:0': data})
其中数据是单个图像的二进制流
data = gfile.FastGFile(img_name, 'rb').read()
我可以将它们堆叠起来,而不是单独传递每个图像流吗?如果图像的大小都不同怎么办? op graph如何处理不同尺寸的图片?
DecodeJpeg 一次只能加载一个图像。您可以在此处查看图像加载后对图像应用 resize_bilinear 操作的一些示例:
将多个图像调整为匹配尺寸后,您可以使用 expand_dims 将它们扩展为 4D,然后沿着批次维度将它们连接在一起以获得批次。