我有standalone.conf
和x_train
的numpy数组,每个数组都大于2GB。我想使用tf.estimator API训练模型,但出现错误:
y_train
我正在使用以下数据传递数据
ValueError: Cannot create a tensor proto whose content is larger than 2GB
tf.data文档mentions this error,并使用带有占位符的传统TenforFlow API提供解决方案。不幸的是,我不知道如何将其转换为tf.estimator API?
答案 0 :(得分:0)
最适合我的解决方案是使用
tf.estimator.inputs.numpy_input_fn(x_train, y_train, num_epochs=EPOCHS,
batch_size=BATCH_SIZE, shuffle=True)
而不是input_fn
。唯一的问题是tf.estimator.inputs.numpy_input_fn
会发出弃用警告,因此很遗憾,这也会停止工作。