{"action":"created","issue":{"url":"https://api.github.com/repos/deeplearning4j/deeplearning4j/issues/3389","repository_url":"https://api.github.com/repos/deeplearning4j/deeplearning4j","labels_url":"https://api.github.com/repos/deeplearning4j/deeplearning4j/issues/3389/labels{/name}","comments_url":"https://api.github.com/repos/deeplearning4j/deeplearning4j/issues/3389/comments","events_url":"https://api.github.com/repos/deeplearning4j/deeplearning4j/issues/3389/events","html_url":"https://github.com/deeplearning4j/deeplearning4j/issues/3389","id":227706252,"number":3389,"title":"Seemingly large memory consumption Keras models","user":{"login":"ErikTromp","id":8345408,"avatar_url":"https://avatars0.githubusercontent.com/u/8345408?v=3","gravatar_id":"","url":"https://api.github.com/users/ErikTromp","html_url":"https://github.com/ErikTromp","followers_url":"https://api.github.com/users/ErikTromp/followers","following_url":"https://api.github.com/users/ErikTromp/following{/other_user}","gists_url":"https://api.github.com/users/ErikTromp/gists{/gist_id}","starred_url":"https://api.github.com/users/ErikTromp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErikTromp/subscriptions","organizations_url":"https://api.github.com/users/ErikTromp/orgs","repos_url":"https://api.github.com/users/ErikTromp/repos","events_url":"https://api.github.com/users/ErikTromp/events{/privacy}","received_events_url":"https://api.github.com/users/ErikTromp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-05-10T14:49:11Z","updated_at":"2017-05-17T00:30:56Z","closed_at":null,"body":"#### Issue Description\r\n**Observed behavior**\r\nTL;DR - Suspiciously high memory usage for Keras models cause OoM\r\n\r\nI am using DL4J to load pre-trained Keras models for VGG16 or (only 1 at a time) InceptionV3. I load the models into memory once and then use it to classify images, but I keep running out of memory all the time. It seems that just loading the models results in 4-5GB of RAM being used, Then once I start classifying images, it slowly rises to 7-8GB, causing my server to go out of memory.\r\n\r\n**Expected behavior**\r\nTL;DR - A lot less memory usage, no OoM\r\nNot fully sure, it might be the high memory usage is normal? But since the models I am using are 90mb (InceptionV3) and 540mb (VGG16) on disk, I would hope to not use so much memory as I am seeing.\r\n\r\nLinks to gists showing my code are here:\r\nhttps://gist.github.com/ErikTromp/d314f0c18c6f09070053fa69d8b9b6dc\r\nhttps://gist.github.com/ErikTromp/9d8e674b40939018bfacee58398529d4\r\nFiles used for VGG16:\r\nhttps://raw.githubusercontent.com/deeplearning4j/dl4j-examples/f9da30063c1636e1de515f2ac514e9a45c1b32cd/dl4j-examples/src/main/resources/trainedModels/VGG16.json\r\nhttps://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_th_dim_ordering_th_kernels.h5\r\nFiles used for InceptionV3\r\nhttps://github.com/USCDataScience/dl4j-kerasimport-examples/blob/master/dl4j-import-example/data/inception-model.json\r\nhttps://github.com/fchollet/deep-learning-models/releases/download/v0.2/inception_v3_weights_tf_dim_ordering_tf_kernels.h5\r\n\r\n#### Version Information\r\nTried on Windows 10 and on Ubuntu 16.04.1 LTS\r\nUsing native (no GPU) DL4J binding, version 0.8.0\r\n"},"comment":{"url":"https://api.github.com/repos/deeplearning4j/deeplearning4j/issues/comments/301951734","html_url":"https://github.com/deeplearning4j/deeplearning4j/issues/3389#issuecomment-301951734","issue_url":"https://api.github.com/repos/deeplearning4j/deeplearning4j/issues/3389","id":301951734,"user":{"login":"saudet","id":3328023,"avatar_url":"https://avatars2.githubusercontent.com/u/3328023?v=3","gravatar_id":"","url":"https://api.github.com/users/saudet","html_url":"https://github.com/saudet","followers_url":"https://api.github.com/users/saudet/followers","following_url":"https://api.github.com/users/saudet/following{/other_user}","gists_url":"https://api.github.com/users/saudet/gists{/gist_id}","starred_url":"https://api.github.com/users/saudet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saudet/subscriptions","organizations_url":"https://api.github.com/users/saudet/orgs","repos_url":"https://api.github.com/users/saudet/repos","events_url":"https://api.github.com/users/saudet/events{/privacy}","received_events_url":"https://api.github.com/users/saudet/received_events","type":"User","site_admin":false},"created_at":"2017-05-17T00:30:56Z","updated_at":"2017-05-17T00:30:56Z","body":"@tomthetrainer By default, in general, yes. It's mainly documented on the following two pages, not sure where would be a good general place to put thaw info though.\r\nhttps://deeplearning4j.org/benchmark\r\nhttps://deeplearning4j.org/spark"}}
{"actor":{"display_login":"saudet"}}