Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 有没有一种方法可以直接从s3读取数据,以便在tensorflow中进行模型训练_Python_Tensorflow_Amazon S3 - Fatal编程技术网

Python 有没有一种方法可以直接从s3读取数据,以便在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

我在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/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。

我有两个问题-

  • 在tensorflow中是否有直接从s3读取数据的方法。看起来支持很好,但我找不到任何例子

  • 如果支持,我的方法正确吗


  • 我也在尝试做同样的事情,我记得读到过任何S3URL(S3://我的文件)都被接受为正确的文件名。