【问题标题】:Tensorflow terminate called after throwing an instance of 'std::system_error'在抛出“std::system_error”的实例后调用 Tensorflow 终止
【发布时间】:2017-11-25 21:14:47
【问题描述】:

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

  • ubuntu 16.04
  • 3 gtx 1080 gpus
  • 张量流 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()

这是我的输入管道

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())

但是我没有发现任何问题,你现在可以帮帮我吗?

【问题讨论】:

  • 这样有限的错误日志很难找到原因。如果可能,在python2.7-dbg 下运行您的代码以获取核心转储,然后上传核心文件(对于 Ubuntu,通常在/var/crash 下)
  • @Qmick Zh 谢谢你的回复,我会用dbg,但现在我发现是哪一行导致错误,你能帮我吗?
  • @Qmick Zh 我应该使用 cuda-dbg 吗?因为我想使用 gpu 。
  • 大部分张量流错误发生在sess.run()。它没有提供太多信息。 std::system_error是Linux下系统调用失败引起的。例如,#processes 的命中限制、内存不足等。我不确定cuda-dbg 是否可以在这种情况下提供帮助。
  • @Qmick Zh 我已经升级到tensorflow 1.4,但是还是不行,我该怎么办?

标签: python tensorflow deep-learning


【解决方案1】:

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

这是关于我的 tensorflow 代码,是某种内存泄漏

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-05-04
    • 2017-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-02
    相关资源
    最近更新 更多