Python 将大熊猫数据帧送入Tensorflow
我试图使用Pandas数据帧中的数据输入Tensorflow管道。我试着这样做:Python 将大熊猫数据帧送入Tensorflow,python,pandas,tensorflow,bigdata,Python,Pandas,Tensorflow,Bigdata,我试图使用Pandas数据帧中的数据输入Tensorflow管道。我试着这样做: training_dataset = (tf.data.Dataset.from_tensor_slices(( tf.cast(df[df.columns[:-1]].values, tf.float32), tf.cast(df[df.columns[-1]].values, tf.int32)))) 其中,df是我的数据帧。但是它非常大,我得到了这个错误: ValueEr
training_dataset = (tf.data.Dataset.from_tensor_slices((
tf.cast(df[df.columns[:-1]].values, tf.float32),
tf.cast(df[df.columns[-1]].values, tf.int32))))
其中,df
是我的数据帧。但是它非常大,我得到了这个错误:
ValueError: Cannot create a tensor proto whose content is larger than 2GB.
我是否应该拆分数据框架并创建几个张量数据集,这是否可行?最好的方法是什么?我想把数据输入到
feed\u dict
,但我不知道怎么做。没有必要手动分割数据帧。您可以使用tf.placeholder
来避免达到2GB graphdef限制。使用dataframe从dataframe创建numpy数组。值
如果你说你不知道如何进行feed\u dict
你能发布到目前为止写的代码吗?:)