9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Tips: Kerasで Resource exhausted: OOM when allocating tensor が出る時チェックすること

Last updated at Posted at 2018-02-27

ずばり

config.gpu_options.allow_growth = True

にしてないでしょうか。

Resource exhausted: OOM when allocating tensor... のエラーはGPUのメモリが足りないときに出るようです。
そして、 config.gpu_options.allow_growthTrue にすると、
実行時に必要な分だけ確保するようになる、というメリットがあるものの、
一方で自動的にはメモリを開放しないので、メモリが断片化して性能が悪化する可能性がある、とのことでした。

私のケースではこの記述を削除した所、エラーが起きなくなりました。

@namakemono さまの記事を参考にさせて頂きました。

以上です!

9
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?