0
我有一個文本文件的大小(20480,8)。我想把第四列中的數據放到一個數組中。我可以使用Python做它作爲使用張量流加載文本文件和訪問數據
file_pathname1 = os.path.join(os.path.expanduser('~'),'TF','1st_test', '20.10.22.12.09.13')
x= np.loadtext(file_pathname1)
y= x[:,4]
#print(np.shape(x))
print(np.shape(y))
我得到y的尺寸爲(20480)
,但我想同樣的複製爲張量。如何訪問數據
file_pathname1 = os.path.join(os.path.expanduser('~'),'TF','1st_test', '20.10.22.12.09.13')
y = tf.read_file(file_pathname1)
sess = tf.Session()
sess.run(y)
print(y.get_shape())
我無法理解我是否已經加載正確的,因爲我得到它爲空數組文件 ()