Home Articles

在抛出'std::system_error'的实例后调用Tensorflow终止

Asked
Viewed 743 times
0

我正在使用具有这些属性的共享服务器训练带有tensorflow的resNet50:

  • ubuntu 16.04

  • 3 gtx 1080 gpus

  • tensorflow 1.3

  • python 2.7

但总是在两个时代之后,在第三个时代,我遇到了这个错误:

terminate called after throwing an instance of 'std::system_error' what():
Resource temporarily unavailable
Aborted (core dumped)

在我的代码中添加一些打印,我发现问题出在哪里:

这是将tfrecord转换为数据集:

filenames = ["balanced_t.tfrecords"]
dataset = tf.contrib.data.TFRecordDataset(filenames)
    def parser(record):
    keys_to_features = {
        # "label": tf.FixedLenFeature((), tf.string, default_value=""),
        "mhot_label_raw": tf.FixedLenFeature((), tf.string, default_value=""),
        "mel_spec_raw": tf.FixedLenFeature((), tf.string, default_value=""),
    }
    parsed = tf.parse_single_example(record, keys_to_features)

    mel_spec1d = tf.decode_raw(parsed['mel_spec_raw'], tf.float64)
    # label = tf.cast(parsed["label"], tf.string)
    mhot_label = tf.decode_raw(parsed['mhot_label_raw'], tf.float64)
    mel_spec = tf.reshape(mel_spec1d, [96, 64])
    # aa=mel_spec
    return {"mel_data": mel_spec}, mhot_label
    dataset = dataset.map(parser)
    dataset = dataset.batch(batch_size)
    dataset = dataset.repeat(3)
    iterator = dataset.make_one_shot_iterator()

这是我输入的pipline

while True:
            try:
               (features, labels) = sess.run(iterator.get_next())
            except tf.errors.OutOfRangeError:
               print("end of training dataset")

由于我的打印输出,错误是这一行:

(features, labels) = sess.run(iterator.get_next())

但我没有看到任何问题,你现在能帮助我吗?

1 Answer

  • 0

    我在另一个话题中提出了我的问题并得到了答案:stack_link

    这是关于我的张量流代码,它是某种内存泄漏

Related