{"action":"created","issue":{"url":"https://api.github.com/repos/davisking/dlib/issues/1136","repository_url":"https://api.github.com/repos/davisking/dlib","labels_url":"https://api.github.com/repos/davisking/dlib/issues/1136/labels{/name}","comments_url":"https://api.github.com/repos/davisking/dlib/issues/1136/comments","events_url":"https://api.github.com/repos/davisking/dlib/issues/1136/events","html_url":"https://github.com/davisking/dlib/issues/1136","id":297536705,"number":1136,"title":"How to free GPU memory completely","user":{"login":"giddyyupp","id":22880785,"avatar_url":"https://avatars1.githubusercontent.com/u/22880785?v=4","gravatar_id":"","url":"https://api.github.com/users/giddyyupp","html_url":"https://github.com/giddyyupp","followers_url":"https://api.github.com/users/giddyyupp/followers","following_url":"https://api.github.com/users/giddyyupp/following{/other_user}","gists_url":"https://api.github.com/users/giddyyupp/gists{/gist_id}","starred_url":"https://api.github.com/users/giddyyupp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giddyyupp/subscriptions","organizations_url":"https://api.github.com/users/giddyyupp/orgs","repos_url":"https://api.github.com/users/giddyyupp/repos","events_url":"https://api.github.com/users/giddyyupp/events{/privacy}","received_events_url":"https://api.github.com/users/giddyyupp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-15T17:45:51Z","updated_at":"2018-02-17T13:47:51Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\ni wonder how to completely free net objects. for instance in the face detection example:  \r\n\r\n// And finally we load the DNN responsible for face recognition.  \r\nanet_type net;  \r\ndeserialize(\"dlib_face_recognition_resnet_model_v1.dat\") >> net;  \r\n\r\nhow can i free **net** object? thanks  \r\n\r\nsource code:  \r\nhttps://github.com/davisking/dlib/blob/master/examples/dnn_face_recognition_ex.cpp"},"comment":{"url":"https://api.github.com/repos/davisking/dlib/issues/comments/366442581","html_url":"https://github.com/davisking/dlib/issues/1136#issuecomment-366442581","issue_url":"https://api.github.com/repos/davisking/dlib/issues/1136","id":366442581,"user":{"login":"giddyyupp","id":22880785,"avatar_url":"https://avatars1.githubusercontent.com/u/22880785?v=4","gravatar_id":"","url":"https://api.github.com/users/giddyyupp","html_url":"https://github.com/giddyyupp","followers_url":"https://api.github.com/users/giddyyupp/followers","following_url":"https://api.github.com/users/giddyyupp/following{/other_user}","gists_url":"https://api.github.com/users/giddyyupp/gists{/gist_id}","starred_url":"https://api.github.com/users/giddyyupp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giddyyupp/subscriptions","organizations_url":"https://api.github.com/users/giddyyupp/orgs","repos_url":"https://api.github.com/users/giddyyupp/repos","events_url":"https://api.github.com/users/giddyyupp/events{/privacy}","received_events_url":"https://api.github.com/users/giddyyupp/received_events","type":"User","site_admin":false},"created_at":"2018-02-17T13:47:51Z","updated_at":"2018-02-17T13:47:51Z","author_association":"NONE","body":"well, lets continue from the first point. and i am using version 19.8 by the way.\r\nexplicitly i can only call this destructor (afaik) and which fails in two different ways accordingly:\r\n**net.~add_loss_layer();**   \r\n\r\n1. if i had run a detection using something like that:\r\n**net(face_chip);** and then i call the prev destructor, it fails in the **matrix_data_layout.h** line **287** it can't deallocate array. and this array is from detection. it belongs to **net.temp_label** variable. by the way **net.clean()** is not cleaning this **temp_label** var. why?\r\n\r\n2. lets say if i called destructor right after I deserialized **net** object. then it fails in the memory where **static_assert(0 < sizeof (_Ty), \"can't delete an incomplete type\");** and here i can see all the **net.subnetwork** var. \r\n\r\nso can you please express what is the proper way to delete and free my gpu memory. thanks in advance.\r\n\r\n"}}
{"actor":{"display_login":"giddyyupp"}}