小编Jua*_*uan的帖子

Tensorflow CPU内存问题(分配超过系统内存的10%)

我使用 Keras/Tensorflow 在 python 中创建了一个程序。我的数据创建和训练没有任何问题。但是,当我想评估我的模型时,出现以下错误:

Using TensorFlow backend.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4213: sparse_to_dense (from tensorflow.python.ops.sparse_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Create a `tf.sparse.SparseTensor` and use `tf.sparse.to_dense` instead.
2018-12-05 19:20:44.932780: W tensorflow/core/framework/allocator.cc:122] Allocation of 3359939800 exceeds 10% of system memory.
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Abandon (core dumped)
Run Code Online (Sandbox Code Playgroud)

看来是内存分配问题。我缩小了模型的大小并缩小了所有参数,但没有任何改变。我不知道如何解决这个问题。

python memory cpu keras tensorflow

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

cpu ×1

keras ×1

memory ×1

python ×1

tensorflow ×1