0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

TensorFlowでpng画像をdecordしようとして上手くいかず結局Numpyで解決した話

Last updated at Posted at 2020-01-13

tensorflowを使って256 px$\times$256 pxのpngデータを

import tensorflow as tf
image = tf.read_file("hoge.png")
image = tf.image.decode_png(image channels=3)

で取得したらshapeが(?, ?, 3)になって困ったので結局numpyを使って

import numpy as np
img = np.array(Image.open("hoge.png"))

をしたらshapeが(256, 256, 3)で正常に得られました。
めでたしめでたし?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?