{"action":"created","comment":{"url":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/comments/53209241","id":53209241,"diff_hunk":"@@ -1049,61 +1057,15 @@ def can_infer_one(self):\n         return False\n \n     @override\n-    def infer_one(self, data, snapshot_epoch=None, layers=None):\n-        if isinstance(self.dataset, dataset.ImageClassificationDatasetJob):\n-            return self.classify_one(data,\n-                    snapshot_epoch=snapshot_epoch,\n-                    layers=layers,\n-                    )\n-        elif isinstance(self.dataset, dataset.GenericImageDatasetJob):\n-            return self.infer_one_generic(data,\n+    def infer_one(self, data, snapshot_epoch=None, layers=None, gpu=-1):\n+        if isinstance(self.dataset, dataset.ImageClassificationDatasetJob) or isinstance(self.dataset, dataset.GenericImageDatasetJob):\n+            return self.infer_one_image(data,\n                     snapshot_epoch=snapshot_epoch,\n                     layers=layers,","path":"digits/model/tasks/caffe_train.py","position":31,"original_position":31,"commit_id":"8b6022162c730826dca17fdc1807f0691d535cc3","original_commit_id":"8b6022162c730826dca17fdc1807f0691d535cc3","user":{"login":"lukeyeager","id":687269,"avatar_url":"https://avatars.githubusercontent.com/u/687269?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeyeager","html_url":"https://github.com/lukeyeager","followers_url":"https://api.github.com/users/lukeyeager/followers","following_url":"https://api.github.com/users/lukeyeager/following{/other_user}","gists_url":"https://api.github.com/users/lukeyeager/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeyeager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeyeager/subscriptions","organizations_url":"https://api.github.com/users/lukeyeager/orgs","repos_url":"https://api.github.com/users/lukeyeager/repos","events_url":"https://api.github.com/users/lukeyeager/events{/privacy}","received_events_url":"https://api.github.com/users/lukeyeager/received_events","type":"User","site_admin":false},"body":"You're missing a `gpu=gpu` here which is causing you to never call `set_mode_gpu()`.","created_at":"2016-02-17T18:36:58Z","updated_at":"2016-02-17T18:36:58Z","html_url":"https://github.com/NVIDIA/DIGITS/pull/573#discussion_r53209241","pull_request_url":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/573","_links":{"self":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/comments/53209241"},"html":{"href":"https://github.com/NVIDIA/DIGITS/pull/573#discussion_r53209241"},"pull_request":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/573"}}},"pull_request":{"url":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/573","id":58915275,"html_url":"https://github.com/NVIDIA/DIGITS/pull/573","diff_url":"https://github.com/NVIDIA/DIGITS/pull/573.diff","patch_url":"https://github.com/NVIDIA/DIGITS/pull/573.patch","issue_url":"https://api.github.com/repos/NVIDIA/DIGITS/issues/573","number":573,"state":"open","locked":false,"title":"Inference jobs","user":{"login":"gheinrich","id":3889770,"avatar_url":"https://avatars.githubusercontent.com/u/3889770?v=3","gravatar_id":"","url":"https://api.github.com/users/gheinrich","html_url":"https://github.com/gheinrich","followers_url":"https://api.github.com/users/gheinrich/followers","following_url":"https://api.github.com/users/gheinrich/following{/other_user}","gists_url":"https://api.github.com/users/gheinrich/gists{/gist_id}","starred_url":"https://api.github.com/users/gheinrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gheinrich/subscriptions","organizations_url":"https://api.github.com/users/gheinrich/orgs","repos_url":"https://api.github.com/users/gheinrich/repos","events_url":"https://api.github.com/users/gheinrich/events{/privacy}","received_events_url":"https://api.github.com/users/gheinrich/received_events","type":"User","site_admin":false},"body":"Move inference to separate job\r\n\r\n### Motivation\r\n\r\n* Allow inference to run on different machine within cluster\r\n* Allow long inference jobs to report progress through socketio\r\n* Allow inference to reserve resources (GPUs)\r\n* Image resizing done outside of server context\r\n* Provide command-line inferface for inference using *exactly* the same path as DIGITS\r\n\r\n### Features \r\n\r\nNo new feature, will implement socketio updates in separate pull request\r\n\r\n### Summary of changes\r\n\r\n* New job and task created for inference\r\n* To limit changes in source code, re-use existing inference API from model job/task\r\n* No code duplication between Caffe/Torch, Classification/Generic\r\n* New inference.py tool performs image resizing and inference\r\n* Results are communicated back to DIGITS through a HDF5 file on filesystem\r\n\r\n### Progress\r\n\r\n- [x] Caffe single-image classification\r\n- [x] Torch single-image classification\r\n- [x] Caffe single-image inference\r\n- [x] Torch single-image inference\r\n- [x] Caffe multiple-image classification\r\n- [x] Torch multiple-image classification\r\n- [x] Caffe multiple-image inference\r\n- [x] Torch multiple-image inference\r\n- [x] Caffe layer visualizations\r\n- [x] Torch layer visualizations\r\n- [x] Delete job when done\r\n- [x] Code Clean-up\r\n- [x] Pass nostests\r\n- [ ] Fix code coverage in presence of sub-processes\r\n- [ ] Fix nosetest slowliness\r\n\r\n\r\n\r\n","created_at":"2016-02-10T16:28:10Z","updated_at":"2016-02-17T18:36:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dfffe2103d7957376252eacc6c8069bb610ef9ee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/573/commits","review_comments_url":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/573/comments","review_comment_url":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NVIDIA/DIGITS/issues/573/comments","statuses_url":"https://api.github.com/repos/NVIDIA/DIGITS/statuses/8b6022162c730826dca17fdc1807f0691d535cc3","head":{"label":"gheinrich:dev/separate-inference","ref":"dev/separate-inference","sha":"8b6022162c730826dca17fdc1807f0691d535cc3","user":{"login":"gheinrich","id":3889770,"avatar_url":"https://avatars.githubusercontent.com/u/3889770?v=3","gravatar_id":"","url":"https://api.github.com/users/gheinrich","html_url":"https://github.com/gheinrich","followers_url":"https://api.github.com/users/gheinrich/followers","following_url":"https://api.github.com/users/gheinrich/following{/other_user}","gists_url":"https://api.github.com/users/gheinrich/gists{/gist_id}","starred_url":"https://api.github.com/users/gheinrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gheinrich/subscriptions","organizations_url":"https://api.github.com/users/gheinrich/orgs","repos_url":"https://api.github.com/users/gheinrich/repos","events_url":"https://api.github.com/users/gheinrich/events{/privacy}","received_events_url":"https://api.github.com/users/gheinrich/received_events","type":"User","site_admin":false},"repo":{"id":39290770,"name":"DIGITS","full_name":"gheinrich/DIGITS","owner":{"login":"gheinrich","id":3889770,"avatar_url":"https://avatars.githubusercontent.com/u/3889770?v=3","gravatar_id":"","url":"https://api.github.com/users/gheinrich","html_url":"https://github.com/gheinrich","followers_url":"https://api.github.com/users/gheinrich/followers","following_url":"https://api.github.com/users/gheinrich/following{/other_user}","gists_url":"https://api.github.com/users/gheinrich/gists{/gist_id}","starred_url":"https://api.github.com/users/gheinrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gheinrich/subscriptions","organizations_url":"https://api.github.com/users/gheinrich/orgs","repos_url":"https://api.github.com/users/gheinrich/repos","events_url":"https://api.github.com/users/gheinrich/events{/privacy}","received_events_url":"https://api.github.com/users/gheinrich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gheinrich/DIGITS","description":"Deep Learning GPU Training System","fork":true,"url":"https://api.github.com/repos/gheinrich/DIGITS","forks_url":"https://api.github.com/repos/gheinrich/DIGITS/forks","keys_url":"https://api.github.com/repos/gheinrich/DIGITS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gheinrich/DIGITS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gheinrich/DIGITS/teams","hooks_url":"https://api.github.com/repos/gheinrich/DIGITS/hooks","issue_events_url":"https://api.github.com/repos/gheinrich/DIGITS/issues/events{/number}","events_url":"https://api.github.com/repos/gheinrich/DIGITS/events","assignees_url":"https://api.github.com/repos/gheinrich/DIGITS/assignees{/user}","branches_url":"https://api.github.com/repos/gheinrich/DIGITS/branches{/branch}","tags_url":"https://api.github.com/repos/gheinrich/DIGITS/tags","blobs_url":"https://api.github.com/repos/gheinrich/DIGITS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gheinrich/DIGITS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gheinrich/DIGITS/git/refs{/sha}","trees_url":"https://api.github.com/repos/gheinrich/DIGITS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gheinrich/DIGITS/statuses/{sha}","languages_url":"https://api.github.com/repos/gheinrich/DIGITS/languages","stargazers_url":"https://api.github.com/repos/gheinrich/DIGITS/stargazers","contributors_url":"https://api.github.com/repos/gheinrich/DIGITS/contributors","subscribers_url":"https://api.github.com/repos/gheinrich/DIGITS/subscribers","subscription_url":"https://api.github.com/repos/gheinrich/DIGITS/subscription","commits_url":"https://api.github.com/repos/gheinrich/DIGITS/commits{/sha}","git_commits_url":"https://api.github.com/repos/gheinrich/DIGITS/git/commits{/sha}","comments_url":"https://api.github.com/repos/gheinrich/DIGITS/comments{/number}","issue_comment_url":"https://api.github.com/repos/gheinrich/DIGITS/issues/comments{/number}","contents_url":"https://api.github.com/repos/gheinrich/DIGITS/contents/{+path}","compare_url":"https://api.github.com/repos/gheinrich/DIGITS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gheinrich/DIGITS/merges","archive_url":"https://api.github.com/repos/gheinrich/DIGITS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gheinrich/DIGITS/downloads","issues_url":"https://api.github.com/repos/gheinrich/DIGITS/issues{/number}","pulls_url":"https://api.github.com/repos/gheinrich/DIGITS/pulls{/number}","milestones_url":"https://api.github.com/repos/gheinrich/DIGITS/milestones{/number}","notifications_url":"https://api.github.com/repos/gheinrich/DIGITS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gheinrich/DIGITS/labels{/name}","releases_url":"https://api.github.com/repos/gheinrich/DIGITS/releases{/id}","deployments_url":"https://api.github.com/repos/gheinrich/DIGITS/deployments","created_at":"2015-07-18T07:39:43Z","updated_at":"2016-01-19T12:15:35Z","pushed_at":"2016-02-17T16:31:15Z","git_url":"git://github.com/gheinrich/DIGITS.git","ssh_url":"git@github.com:gheinrich/DIGITS.git","clone_url":"https://github.com/gheinrich/DIGITS.git","svn_url":"https://github.com/gheinrich/DIGITS","homepage":"https://developer.nvidia.com/digits","size":8833,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"NVIDIA:master","ref":"master","sha":"9419536bbcc2b2fb50e1ffa6e105fb8ab80b65fa","user":{"login":"NVIDIA","id":1728152,"avatar_url":"https://avatars.githubusercontent.com/u/1728152?v=3","gravatar_id":"","url":"https://api.github.com/users/NVIDIA","html_url":"https://github.com/NVIDIA","followers_url":"https://api.github.com/users/NVIDIA/followers","following_url":"https://api.github.com/users/NVIDIA/following{/other_user}","gists_url":"https://api.github.com/users/NVIDIA/gists{/gist_id}","starred_url":"https://api.github.com/users/NVIDIA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NVIDIA/subscriptions","organizations_url":"https://api.github.com/users/NVIDIA/orgs","repos_url":"https://api.github.com/users/NVIDIA/repos","events_url":"https://api.github.com/users/NVIDIA/events{/privacy}","received_events_url":"https://api.github.com/users/NVIDIA/received_events","type":"Organization","site_admin":false},"repo":{"id":32403967,"name":"DIGITS","full_name":"NVIDIA/DIGITS","owner":{"login":"NVIDIA","id":1728152,"avatar_url":"https://avatars.githubusercontent.com/u/1728152?v=3","gravatar_id":"","url":"https://api.github.com/users/NVIDIA","html_url":"https://github.com/NVIDIA","followers_url":"https://api.github.com/users/NVIDIA/followers","following_url":"https://api.github.com/users/NVIDIA/following{/other_user}","gists_url":"https://api.github.com/users/NVIDIA/gists{/gist_id}","starred_url":"https://api.github.com/users/NVIDIA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NVIDIA/subscriptions","organizations_url":"https://api.github.com/users/NVIDIA/orgs","repos_url":"https://api.github.com/users/NVIDIA/repos","events_url":"https://api.github.com/users/NVIDIA/events{/privacy}","received_events_url":"https://api.github.com/users/NVIDIA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NVIDIA/DIGITS","description":"Deep Learning GPU Training System","fork":false,"url":"https://api.github.com/repos/NVIDIA/DIGITS","forks_url":"https://api.github.com/repos/NVIDIA/DIGITS/forks","keys_url":"https://api.github.com/repos/NVIDIA/DIGITS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NVIDIA/DIGITS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NVIDIA/DIGITS/teams","hooks_url":"https://api.github.com/repos/NVIDIA/DIGITS/hooks","issue_events_url":"https://api.github.com/repos/NVIDIA/DIGITS/issues/events{/number}","events_url":"https://api.github.com/repos/NVIDIA/DIGITS/events","assignees_url":"https://api.github.com/repos/NVIDIA/DIGITS/assignees{/user}","branches_url":"https://api.github.com/repos/NVIDIA/DIGITS/branches{/branch}","tags_url":"https://api.github.com/repos/NVIDIA/DIGITS/tags","blobs_url":"https://api.github.com/repos/NVIDIA/DIGITS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NVIDIA/DIGITS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NVIDIA/DIGITS/git/refs{/sha}","trees_url":"https://api.github.com/repos/NVIDIA/DIGITS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NVIDIA/DIGITS/statuses/{sha}","languages_url":"https://api.github.com/repos/NVIDIA/DIGITS/languages","stargazers_url":"https://api.github.com/repos/NVIDIA/DIGITS/stargazers","contributors_url":"https://api.github.com/repos/NVIDIA/DIGITS/contributors","subscribers_url":"https://api.github.com/repos/NVIDIA/DIGITS/subscribers","subscription_url":"https://api.github.com/repos/NVIDIA/DIGITS/subscription","commits_url":"https://api.github.com/repos/NVIDIA/DIGITS/commits{/sha}","git_commits_url":"https://api.github.com/repos/NVIDIA/DIGITS/git/commits{/sha}","comments_url":"https://api.github.com/repos/NVIDIA/DIGITS/comments{/number}","issue_comment_url":"https://api.github.com/repos/NVIDIA/DIGITS/issues/comments{/number}","contents_url":"https://api.github.com/repos/NVIDIA/DIGITS/contents/{+path}","compare_url":"https://api.github.com/repos/NVIDIA/DIGITS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NVIDIA/DIGITS/merges","archive_url":"https://api.github.com/repos/NVIDIA/DIGITS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NVIDIA/DIGITS/downloads","issues_url":"https://api.github.com/repos/NVIDIA/DIGITS/issues{/number}","pulls_url":"https://api.github.com/repos/NVIDIA/DIGITS/pulls{/number}","milestones_url":"https://api.github.com/repos/NVIDIA/DIGITS/milestones{/number}","notifications_url":"https://api.github.com/repos/NVIDIA/DIGITS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NVIDIA/DIGITS/labels{/name}","releases_url":"https://api.github.com/repos/NVIDIA/DIGITS/releases{/id}","deployments_url":"https://api.github.com/repos/NVIDIA/DIGITS/deployments","created_at":"2015-03-17T16:00:20Z","updated_at":"2016-02-17T14:43:42Z","pushed_at":"2016-02-17T18:04:35Z","git_url":"git://github.com/NVIDIA/DIGITS.git","ssh_url":"git@github.com:NVIDIA/DIGITS.git","clone_url":"https://github.com/NVIDIA/DIGITS.git","svn_url":"https://github.com/NVIDIA/DIGITS","homepage":"https://developer.nvidia.com/digits","size":13183,"stargazers_count":906,"watchers_count":906,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":266,"mirror_url":null,"open_issues_count":48,"forks":266,"open_issues":48,"watchers":906,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/573"},"html":{"href":"https://github.com/NVIDIA/DIGITS/pull/573"},"issue":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/issues/573"},"comments":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/issues/573/comments"},"review_comments":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/573/comments"},"review_comment":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/pulls/573/commits"},"statuses":{"href":"https://api.github.com/repos/NVIDIA/DIGITS/statuses/8b6022162c730826dca17fdc1807f0691d535cc3"}}}}