コード例 #1
0
ファイル: resnet_main.py プロジェクト: ray-project/sandbox
def get_data(path, size, dataset):
    # Retrieves all preprocessed images and labels using a tensorflow queue.
    # This only uses the cpu.
    os.environ["CUDA_VISIBLE_DEVICES"] = ""
    with tf.device("/cpu:0"):
        dataset = cifar_input.build_data(path, size, dataset)
        sess = tf.Session()
        images, labels = sess.run(dataset)
        sess.close()
        return images, labels
コード例 #2
0
ファイル: resnet_main.py プロジェクト: robertnishihara/ray
def get_data(path, size, dataset):
    # Retrieves all preprocessed images and labels using a tensorflow queue.
    # This only uses the cpu.
    os.environ["CUDA_VISIBLE_DEVICES"] = ""
    with tf.device("/cpu:0"):
        dataset = cifar_input.build_data(path, size, dataset)
        sess = tf.Session()
        images, labels = sess.run(dataset)
        sess.close()
        return images, labels
コード例 #3
0
ファイル: resnet_main.py プロジェクト: newadays/ray
def get_data(path, size):
    os.environ['CUDA_VISIBLE_DEVICES'] = ''
    with tf.device('/cpu:0'):
        queue = cifar_input.build_data(path, size)
        sess = tf.Session()
        coord = tf.train.Coordinator()
        tf.train.start_queue_runners(sess, coord=coord)
        images, labels = sess.run(queue)
        coord.request_stop()
        sess.close()
        return (images[:int(size / 3), :],
                images[int(size / 3):int(2 * size / 3), :],
                images[int(2 * size / 3):, :], labels)
コード例 #4
0
def get_data(path, size, dataset):
    # Retrieves all preprocessed images and labels using a tensorflow queue.
    # This only uses the cpu.
    os.environ["CUDA_VISIBLE_DEVICES"] = ""
    with tf.device("/cpu:0"):
        queue = cifar_input.build_data(path, size, dataset)
        sess = tf.Session()
        coord = tf.train.Coordinator()
        tf.train.start_queue_runners(sess, coord=coord)
        images, labels = sess.run(queue)
        coord.request_stop()
        sess.close()
        return images, labels