Python 有没有一种方法可以直接从s3读取数据,以便在tensorflow中进行模型训练
我在s3中有TF记录,我想直接读取这些文件并将它们输入tensorflow训练Python 有没有一种方法可以直接从s3读取数据,以便在tensorflow中进行模型训练,python,tensorflow,amazon-s3,Python,Tensorflow,Amazon S3,我在s3中有TF记录,我想直接读取这些文件并将它们输入tensorflow训练 filename = "s3location" filename_queue = tf.train.string_input_producer([filename]) with tf.Session() as sess: _, value = tf.TFRecordReader().read(filename_queue) feature = {'train/imag
filename = "s3location"
filename_queue = tf.train.string_input_producer([filename])
with tf.Session() as sess:
_, value = tf.TFRecordReader().read(filename_queue)
feature = {'train/image': tf.FixedLenFeature([], tf.string),
'train/label': tf.FixedLenFeature([], tf.int64)}
features = tf.parse_single_example(value, features=feature)
image = tf.decode_raw(features['train/image'], tf.float32)
label = tf.cast(features['train/label'], tf.int32)
image = tf.reshape(image, [32, 32, 1])
images, labels = tf.train.shuffle_batch([image, label], batch_size=50, capacity=100, num_threads=1, min_after_dequeue=10)
但是,当我试图为这个sess.run(train,feed_dict={x:images,y:labels,hold_prob:0.5})提供数据时,
我得到以下错误-
TypeError:提要的值不能是tf.Tensor对象。可接受的提要值包括Python标量、字符串、列表、numpy ndarray或TensorHandles。
我有两个问题-
我也在尝试做同样的事情,我记得读到过任何S3URL(S3://我的文件)都被接受为正确的文件名。