{"action":"created","comment":{"url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/comments/186860255","pull_request_review_id":118524791,"id":186860255,"diff_hunk":"@@ -0,0 +1,91 @@\n+\"\"\"Benchmark a Resnet50 model\n+Credit:\n+Script modified from TensorFlow Benchmark repo:\n+https://github.com/tensorflow/benchmarks/blob/keras-benchmarks/scripts/keras_benchmarks/models/resnet50_benchmark.py\n+\"\"\"\n+\n+from __future__ import print_function\n+\n+import time\n+\n+import numpy as np\n+from models import timehistory\n+\n+import keras\n+\n+\n+def crossentropy_from_logits(y_true, y_pred):\n+    return keras.backend.categorical_crossentropy(target=y_true,\n+                                                  output=y_pred,\n+                                                  from_logits=True)\n+\n+\n+class Resnet50Benchmark:\n+\n+    def __init__(self):\n+        self.test_name = \"resnet50\"\n+        self.sample_type = \"images\"\n+        self.total_time = 0\n+        self.batch_size = 32\n+        self.epochs = 20\n+        self.num_samples = 1000\n+        self.test_type = 'tf.keras, eager_mode'\n+\n+    def run_benchmark(self, gpus=0, inference=False, use_dataset_tensors=False, epochs=20):\n+        self.epochs = epochs\n+        print(\"Running model \", self.test_name)\n+        keras.backend.set_learning_phase(True)\n+\n+        input_shape = (self.num_samples, 3, 256, 256)\n+        num_classes = 1000\n+\n+        x_train = np.random.randint(0, 255, input_shape)\n+        y_train = np.random.randint(0, num_classes, (input_shape[0],))\n+        y_train = keras.utils.to_categorical(y_train, num_classes)\n+\n+        if (keras.backend.backend() == \"tensorflow\" or keras.backend.backend() == \"mxnet\") and gpus >= 1:","path":"keras_benchmark/scripts/models/resnet50_benchmark.py","position":46,"original_position":46,"commit_id":"2f1ca1197a1ded01abf8f192d9113760d93aa0ef","original_commit_id":"2f1ca1197a1ded01abf8f192d9113760d93aa0ef","user":{"login":"kalyc","id":8603626,"avatar_url":"https://avatars3.githubusercontent.com/u/8603626?v=4","gravatar_id":"","url":"https://api.github.com/users/kalyc","html_url":"https://github.com/kalyc","followers_url":"https://api.github.com/users/kalyc/followers","following_url":"https://api.github.com/users/kalyc/following{/other_user}","gists_url":"https://api.github.com/users/kalyc/gists{/gist_id}","starred_url":"https://api.github.com/users/kalyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalyc/subscriptions","organizations_url":"https://api.github.com/users/kalyc/orgs","repos_url":"https://api.github.com/users/kalyc/repos","events_url":"https://api.github.com/users/kalyc/events{/privacy}","received_events_url":"https://api.github.com/users/kalyc/received_events","type":"User","site_admin":false},"body":"why are you checking for `gpus >= 1` here? ","created_at":"2018-05-08T20:40:24Z","updated_at":"2018-05-08T20:40:24Z","html_url":"https://github.com/leleamol/deep-learning-benchmark-mirror/pull/10#discussion_r186860255","pull_request_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/10","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/comments/186860255"},"html":{"href":"https://github.com/leleamol/deep-learning-benchmark-mirror/pull/10#discussion_r186860255"},"pull_request":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/10","id":186691389,"html_url":"https://github.com/leleamol/deep-learning-benchmark-mirror/pull/10","diff_url":"https://github.com/leleamol/deep-learning-benchmark-mirror/pull/10.diff","patch_url":"https://github.com/leleamol/deep-learning-benchmark-mirror/pull/10.patch","issue_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/issues/10","number":10,"state":"open","locked":false,"title":"Integrate Keras benchmark script to benchmarkAI","user":{"login":"karan6181","id":12561286,"avatar_url":"https://avatars2.githubusercontent.com/u/12561286?v=4","gravatar_id":"","url":"https://api.github.com/users/karan6181","html_url":"https://github.com/karan6181","followers_url":"https://api.github.com/users/karan6181/followers","following_url":"https://api.github.com/users/karan6181/following{/other_user}","gists_url":"https://api.github.com/users/karan6181/gists{/gist_id}","starred_url":"https://api.github.com/users/karan6181/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karan6181/subscriptions","organizations_url":"https://api.github.com/users/karan6181/orgs","repos_url":"https://api.github.com/users/karan6181/repos","events_url":"https://api.github.com/users/karan6181/events{/privacy}","received_events_url":"https://api.github.com/users/karan6181/received_events","type":"User","site_admin":false},"body":"- Integrate Keras benchmark script to benchmarkAI\r\n\r\n @sandeep-krishnamurthy  @leleamol @roywei @kalyc","created_at":"2018-05-08T16:39:46Z","updated_at":"2018-05-08T20:40:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/10/commits","review_comments_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/10/comments","review_comment_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/issues/10/comments","statuses_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/statuses/2f1ca1197a1ded01abf8f192d9113760d93aa0ef","head":{"label":"karan6181:master","ref":"master","sha":"2f1ca1197a1ded01abf8f192d9113760d93aa0ef","user":{"login":"karan6181","id":12561286,"avatar_url":"https://avatars2.githubusercontent.com/u/12561286?v=4","gravatar_id":"","url":"https://api.github.com/users/karan6181","html_url":"https://github.com/karan6181","followers_url":"https://api.github.com/users/karan6181/followers","following_url":"https://api.github.com/users/karan6181/following{/other_user}","gists_url":"https://api.github.com/users/karan6181/gists{/gist_id}","starred_url":"https://api.github.com/users/karan6181/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karan6181/subscriptions","organizations_url":"https://api.github.com/users/karan6181/orgs","repos_url":"https://api.github.com/users/karan6181/repos","events_url":"https://api.github.com/users/karan6181/events{/privacy}","received_events_url":"https://api.github.com/users/karan6181/received_events","type":"User","site_admin":false},"repo":{"id":131332096,"name":"deep-learning-benchmark-mirror","full_name":"karan6181/deep-learning-benchmark-mirror","owner":{"login":"karan6181","id":12561286,"avatar_url":"https://avatars2.githubusercontent.com/u/12561286?v=4","gravatar_id":"","url":"https://api.github.com/users/karan6181","html_url":"https://github.com/karan6181","followers_url":"https://api.github.com/users/karan6181/followers","following_url":"https://api.github.com/users/karan6181/following{/other_user}","gists_url":"https://api.github.com/users/karan6181/gists{/gist_id}","starred_url":"https://api.github.com/users/karan6181/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karan6181/subscriptions","organizations_url":"https://api.github.com/users/karan6181/orgs","repos_url":"https://api.github.com/users/karan6181/repos","events_url":"https://api.github.com/users/karan6181/events{/privacy}","received_events_url":"https://api.github.com/users/karan6181/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/karan6181/deep-learning-benchmark-mirror","description":"This is mirror of deep-learning-benchmark","fork":true,"url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror","forks_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/forks","keys_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/teams","hooks_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/hooks","issue_events_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/issues/events{/number}","events_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/events","assignees_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/assignees{/user}","branches_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/branches{/branch}","tags_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/tags","blobs_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/git/refs{/sha}","trees_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/statuses/{sha}","languages_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/languages","stargazers_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/stargazers","contributors_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/contributors","subscribers_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/subscribers","subscription_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/subscription","commits_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/commits{/sha}","git_commits_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/git/commits{/sha}","comments_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/comments{/number}","issue_comment_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/issues/comments{/number}","contents_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/contents/{+path}","compare_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/merges","archive_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/downloads","issues_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/issues{/number}","pulls_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/pulls{/number}","milestones_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/milestones{/number}","notifications_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/labels{/name}","releases_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/releases{/id}","deployments_url":"https://api.github.com/repos/karan6181/deep-learning-benchmark-mirror/deployments","created_at":"2018-04-27T18:32:05Z","updated_at":"2018-05-03T21:18:13Z","pushed_at":"2018-05-03T21:18:11Z","git_url":"git://github.com/karan6181/deep-learning-benchmark-mirror.git","ssh_url":"git@github.com:karan6181/deep-learning-benchmark-mirror.git","clone_url":"https://github.com/karan6181/deep-learning-benchmark-mirror.git","svn_url":"https://github.com/karan6181/deep-learning-benchmark-mirror","homepage":null,"size":27643,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"leleamol:master","ref":"master","sha":"67d024b033b5c81f3c7ea3903724f7dd6aac8ffd","user":{"login":"leleamol","id":19983848,"avatar_url":"https://avatars3.githubusercontent.com/u/19983848?v=4","gravatar_id":"","url":"https://api.github.com/users/leleamol","html_url":"https://github.com/leleamol","followers_url":"https://api.github.com/users/leleamol/followers","following_url":"https://api.github.com/users/leleamol/following{/other_user}","gists_url":"https://api.github.com/users/leleamol/gists{/gist_id}","starred_url":"https://api.github.com/users/leleamol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleamol/subscriptions","organizations_url":"https://api.github.com/users/leleamol/orgs","repos_url":"https://api.github.com/users/leleamol/repos","events_url":"https://api.github.com/users/leleamol/events{/privacy}","received_events_url":"https://api.github.com/users/leleamol/received_events","type":"User","site_admin":false},"repo":{"id":121544635,"name":"deep-learning-benchmark-mirror","full_name":"leleamol/deep-learning-benchmark-mirror","owner":{"login":"leleamol","id":19983848,"avatar_url":"https://avatars3.githubusercontent.com/u/19983848?v=4","gravatar_id":"","url":"https://api.github.com/users/leleamol","html_url":"https://github.com/leleamol","followers_url":"https://api.github.com/users/leleamol/followers","following_url":"https://api.github.com/users/leleamol/following{/other_user}","gists_url":"https://api.github.com/users/leleamol/gists{/gist_id}","starred_url":"https://api.github.com/users/leleamol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleamol/subscriptions","organizations_url":"https://api.github.com/users/leleamol/orgs","repos_url":"https://api.github.com/users/leleamol/repos","events_url":"https://api.github.com/users/leleamol/events{/privacy}","received_events_url":"https://api.github.com/users/leleamol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leleamol/deep-learning-benchmark-mirror","description":"This is mirror of deep-learning-benchmark","fork":false,"url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror","forks_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/forks","keys_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/teams","hooks_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/hooks","issue_events_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/issues/events{/number}","events_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/events","assignees_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/assignees{/user}","branches_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/branches{/branch}","tags_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/tags","blobs_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/git/refs{/sha}","trees_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/statuses/{sha}","languages_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/languages","stargazers_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/stargazers","contributors_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/contributors","subscribers_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/subscribers","subscription_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/subscription","commits_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/commits{/sha}","git_commits_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/git/commits{/sha}","comments_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/comments{/number}","issue_comment_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/issues/comments{/number}","contents_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/contents/{+path}","compare_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/merges","archive_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/downloads","issues_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/issues{/number}","pulls_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls{/number}","milestones_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/milestones{/number}","notifications_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/labels{/name}","releases_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/releases{/id}","deployments_url":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/deployments","created_at":"2018-02-14T18:16:49Z","updated_at":"2018-05-04T23:36:16Z","pushed_at":"2018-05-08T16:39:47Z","git_url":"git://github.com/leleamol/deep-learning-benchmark-mirror.git","ssh_url":"git@github.com:leleamol/deep-learning-benchmark-mirror.git","clone_url":"https://github.com/leleamol/deep-learning-benchmark-mirror.git","svn_url":"https://github.com/leleamol/deep-learning-benchmark-mirror","homepage":null,"size":194,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":6,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/10"},"html":{"href":"https://github.com/leleamol/deep-learning-benchmark-mirror/pull/10"},"issue":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/issues/10"},"comments":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/leleamol/deep-learning-benchmark-mirror/statuses/2f1ca1197a1ded01abf8f192d9113760d93aa0ef"}},"author_association":"NONE"}}
{"actor":{"display_login":"kalyc"}}