import tensorflow as tf
import matplotlib.pyplot as plt
print(123)
'''
tensorlfow split的使用
value=img, 传入的图片
num_or_size_splits=3, 分割的数量
axis=2 ,分割的channel
若batch图片,则为 tf.split(value=img, num_or_size_splits=3, axis=3)
变成(batch, w, h, 1), (batch, w, h, 1), (batch, w, h, 1)
'''
img = tf.truncated_normal(shape=(200,300,3))
r ,g ,b = tf.split(value=img, num_or_size_splits=3, axis=2)
r = tf.squeeze(r)
with tf.Session() as sess:
plt.imshow(sess.run(r))
plt.show()