【发布时间】:2018-04-08 17:32:35
【问题描述】:
我正在使用在 CPU 上运行的 Tensorflow DNNClassifier。我已经完成了培训,现在正在反复拨打estimator.predict,在拨打了几千次电话后,我得到了以下信息。我很困惑,因为我认为进行预测本身不会增加内存(我看到其他一些人提出了类似的错误,但他们使用的是 GPU 并在训练期间看到了错误)。
....
File "C:\Users\Zvi\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 1654, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[973771,128] and type float on /job:localhost/replica:0/task:0/device:CPU:0 by allocator cpu
[[Node: save/AssignVariableOp = AssignVariableOp[dtype=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](dnn/input_from_feature_columns/input_layer/product_hub_module_embedding/module/embeddings/part_0, save/Identity_7)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.
【问题讨论】:
标签: python tensorflow deep-learning out-of-memory tensorflow-estimator