So when I save a int16 numpy array and reload it I get the same shape as expected. In this particular case the shape is (335,306,306) yielding a size of 31368060.
Now I am attempting to load such arrays into a tensorflow pipeline as follows;
def loadFiles():
imgPaths = glob.glob("*.npy") # List containing the one numpy array
Q = tf.train.string_input_producer(imgPaths,num_epochs=10,shuffle=True)
reader = tf.WholeFileReader()
key, value = reader.read(Q)
image_bytes = tf.decode_raw(value,tf.int16)
return key, image_bytes
Evaluating the same example in a session I get;
p,img = loadFiles()
with tf.Session() as sess:
tf.global_variables_initializer().run()
tf.local_variables_initializer().run()
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(coord=coord,sess=sess)
im = img.eval()
print(im.shape)
Yielding (31368100,) which is not the same as (31368060,). What is going wrong?