{"action":"created","comment":{"url":"https://api.github.com/repos/keras-team/keras/pulls/comments/180899813","pull_request_review_id":111404734,"id":180899813,"diff_hunk":"@@ -1458,7 +1458,10 @@ def _standardize_user_data(self, x, y,\n         output_shapes = []\n         for output_shape, loss_fn in zip(self._feed_output_shapes, self._feed_loss_fns):\n             if loss_fn is losses.sparse_categorical_crossentropy:\n-                output_shapes.append(output_shape[:-1] + (1,))\n+                if K.image_data_format() == 'channels_last':\n+                    output_shapes.append(output_shape[:-1] + (1,))\n+                else:","path":"keras/engine/training.py","position":7,"original_position":7,"commit_id":"a7a08bd54e4a130fdac6c1135e3d302214e8e63f","original_commit_id":"a7a08bd54e4a130fdac6c1135e3d302214e8e63f","user":{"login":"fchollet","id":710255,"avatar_url":"https://avatars3.githubusercontent.com/u/710255?v=4","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"body":"Please only do this when `len(output_shape) in {4, 5}`. It *could* be that we have a 3D (timeseries) output while the user has set `image_data_format = \"channels_first\"`. The class axis is still -1 in this case.","created_at":"2018-04-11T21:11:53Z","updated_at":"2018-04-11T21:11:54Z","html_url":"https://github.com/keras-team/keras/pull/9715#discussion_r180899813","pull_request_url":"https://api.github.com/repos/keras-team/keras/pulls/9715","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/keras-team/keras/pulls/comments/180899813"},"html":{"href":"https://github.com/keras-team/keras/pull/9715#discussion_r180899813"},"pull_request":{"href":"https://api.github.com/repos/keras-team/keras/pulls/9715"}}},"pull_request":{"url":"https://api.github.com/repos/keras-team/keras/pulls/9715","id":176404275,"html_url":"https://github.com/keras-team/keras/pull/9715","diff_url":"https://github.com/keras-team/keras/pull/9715.diff","patch_url":"https://github.com/keras-team/keras/pull/9715.patch","issue_url":"https://api.github.com/repos/keras-team/keras/issues/9715","number":9715,"state":"open","locked":false,"title":"Supporting channels_first data format","user":{"login":"tiferet","id":13252556,"avatar_url":"https://avatars1.githubusercontent.com/u/13252556?v=4","gravatar_id":"","url":"https://api.github.com/users/tiferet","html_url":"https://github.com/tiferet","followers_url":"https://api.github.com/users/tiferet/followers","following_url":"https://api.github.com/users/tiferet/following{/other_user}","gists_url":"https://api.github.com/users/tiferet/gists{/gist_id}","starred_url":"https://api.github.com/users/tiferet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiferet/subscriptions","organizations_url":"https://api.github.com/users/tiferet/orgs","repos_url":"https://api.github.com/users/tiferet/repos","events_url":"https://api.github.com/users/tiferet/events{/privacy}","received_events_url":"https://api.github.com/users/tiferet/received_events","type":"User","site_admin":false},"body":"Fix two places in the codebase that don't properly support 'channels_first' data format:\r\n\r\n(1) When standardizing the user data for sparse_categorical_crossentropy loss, take into account the image_data_format when deciding where to add in a channels axis of size 1.\r\n\r\n(2) Util to convert labels to one-hot encoding should take into account the image_data_format when deciding where to place the channels axis.","created_at":"2018-03-21T08:12:56Z","updated_at":"2018-04-11T21:11:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10546680d7e9e81092375115293d5d732a605925","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/keras-team/keras/pulls/9715/commits","review_comments_url":"https://api.github.com/repos/keras-team/keras/pulls/9715/comments","review_comment_url":"https://api.github.com/repos/keras-team/keras/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keras-team/keras/issues/9715/comments","statuses_url":"https://api.github.com/repos/keras-team/keras/statuses/a7a08bd54e4a130fdac6c1135e3d302214e8e63f","head":{"label":"tiferet:channels_first_fix","ref":"channels_first_fix","sha":"a7a08bd54e4a130fdac6c1135e3d302214e8e63f","user":{"login":"tiferet","id":13252556,"avatar_url":"https://avatars1.githubusercontent.com/u/13252556?v=4","gravatar_id":"","url":"https://api.github.com/users/tiferet","html_url":"https://github.com/tiferet","followers_url":"https://api.github.com/users/tiferet/followers","following_url":"https://api.github.com/users/tiferet/following{/other_user}","gists_url":"https://api.github.com/users/tiferet/gists{/gist_id}","starred_url":"https://api.github.com/users/tiferet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiferet/subscriptions","organizations_url":"https://api.github.com/users/tiferet/orgs","repos_url":"https://api.github.com/users/tiferet/repos","events_url":"https://api.github.com/users/tiferet/events{/privacy}","received_events_url":"https://api.github.com/users/tiferet/received_events","type":"User","site_admin":false},"repo":{"id":81536146,"name":"keras","full_name":"tiferet/keras","owner":{"login":"tiferet","id":13252556,"avatar_url":"https://avatars1.githubusercontent.com/u/13252556?v=4","gravatar_id":"","url":"https://api.github.com/users/tiferet","html_url":"https://github.com/tiferet","followers_url":"https://api.github.com/users/tiferet/followers","following_url":"https://api.github.com/users/tiferet/following{/other_user}","gists_url":"https://api.github.com/users/tiferet/gists{/gist_id}","starred_url":"https://api.github.com/users/tiferet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiferet/subscriptions","organizations_url":"https://api.github.com/users/tiferet/orgs","repos_url":"https://api.github.com/users/tiferet/repos","events_url":"https://api.github.com/users/tiferet/events{/privacy}","received_events_url":"https://api.github.com/users/tiferet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tiferet/keras","description":"Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on Theano or TensorFlow.","fork":true,"url":"https://api.github.com/repos/tiferet/keras","forks_url":"https://api.github.com/repos/tiferet/keras/forks","keys_url":"https://api.github.com/repos/tiferet/keras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tiferet/keras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tiferet/keras/teams","hooks_url":"https://api.github.com/repos/tiferet/keras/hooks","issue_events_url":"https://api.github.com/repos/tiferet/keras/issues/events{/number}","events_url":"https://api.github.com/repos/tiferet/keras/events","assignees_url":"https://api.github.com/repos/tiferet/keras/assignees{/user}","branches_url":"https://api.github.com/repos/tiferet/keras/branches{/branch}","tags_url":"https://api.github.com/repos/tiferet/keras/tags","blobs_url":"https://api.github.com/repos/tiferet/keras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tiferet/keras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tiferet/keras/git/refs{/sha}","trees_url":"https://api.github.com/repos/tiferet/keras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tiferet/keras/statuses/{sha}","languages_url":"https://api.github.com/repos/tiferet/keras/languages","stargazers_url":"https://api.github.com/repos/tiferet/keras/stargazers","contributors_url":"https://api.github.com/repos/tiferet/keras/contributors","subscribers_url":"https://api.github.com/repos/tiferet/keras/subscribers","subscription_url":"https://api.github.com/repos/tiferet/keras/subscription","commits_url":"https://api.github.com/repos/tiferet/keras/commits{/sha}","git_commits_url":"https://api.github.com/repos/tiferet/keras/git/commits{/sha}","comments_url":"https://api.github.com/repos/tiferet/keras/comments{/number}","issue_comment_url":"https://api.github.com/repos/tiferet/keras/issues/comments{/number}","contents_url":"https://api.github.com/repos/tiferet/keras/contents/{+path}","compare_url":"https://api.github.com/repos/tiferet/keras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tiferet/keras/merges","archive_url":"https://api.github.com/repos/tiferet/keras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tiferet/keras/downloads","issues_url":"https://api.github.com/repos/tiferet/keras/issues{/number}","pulls_url":"https://api.github.com/repos/tiferet/keras/pulls{/number}","milestones_url":"https://api.github.com/repos/tiferet/keras/milestones{/number}","notifications_url":"https://api.github.com/repos/tiferet/keras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tiferet/keras/labels{/name}","releases_url":"https://api.github.com/repos/tiferet/keras/releases{/id}","deployments_url":"https://api.github.com/repos/tiferet/keras/deployments","created_at":"2017-02-10T06:52:52Z","updated_at":"2018-03-21T07:20:53Z","pushed_at":"2018-04-11T06:40:58Z","git_url":"git://github.com/tiferet/keras.git","ssh_url":"git@github.com:tiferet/keras.git","clone_url":"https://github.com/tiferet/keras.git","svn_url":"https://github.com/tiferet/keras","homepage":"http://keras.io/","size":10624,"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":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"keras-team:master","ref":"master","sha":"a69008527787c387be7d7d4f6de91f9f08396dbc","user":{"login":"keras-team","id":34455048,"avatar_url":"https://avatars0.githubusercontent.com/u/34455048?v=4","gravatar_id":"","url":"https://api.github.com/users/keras-team","html_url":"https://github.com/keras-team","followers_url":"https://api.github.com/users/keras-team/followers","following_url":"https://api.github.com/users/keras-team/following{/other_user}","gists_url":"https://api.github.com/users/keras-team/gists{/gist_id}","starred_url":"https://api.github.com/users/keras-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keras-team/subscriptions","organizations_url":"https://api.github.com/users/keras-team/orgs","repos_url":"https://api.github.com/users/keras-team/repos","events_url":"https://api.github.com/users/keras-team/events{/privacy}","received_events_url":"https://api.github.com/users/keras-team/received_events","type":"Organization","site_admin":false},"repo":{"id":33015583,"name":"keras","full_name":"keras-team/keras","owner":{"login":"keras-team","id":34455048,"avatar_url":"https://avatars0.githubusercontent.com/u/34455048?v=4","gravatar_id":"","url":"https://api.github.com/users/keras-team","html_url":"https://github.com/keras-team","followers_url":"https://api.github.com/users/keras-team/followers","following_url":"https://api.github.com/users/keras-team/following{/other_user}","gists_url":"https://api.github.com/users/keras-team/gists{/gist_id}","starred_url":"https://api.github.com/users/keras-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keras-team/subscriptions","organizations_url":"https://api.github.com/users/keras-team/orgs","repos_url":"https://api.github.com/users/keras-team/repos","events_url":"https://api.github.com/users/keras-team/events{/privacy}","received_events_url":"https://api.github.com/users/keras-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keras-team/keras","description":"Deep Learning for humans","fork":false,"url":"https://api.github.com/repos/keras-team/keras","forks_url":"https://api.github.com/repos/keras-team/keras/forks","keys_url":"https://api.github.com/repos/keras-team/keras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keras-team/keras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keras-team/keras/teams","hooks_url":"https://api.github.com/repos/keras-team/keras/hooks","issue_events_url":"https://api.github.com/repos/keras-team/keras/issues/events{/number}","events_url":"https://api.github.com/repos/keras-team/keras/events","assignees_url":"https://api.github.com/repos/keras-team/keras/assignees{/user}","branches_url":"https://api.github.com/repos/keras-team/keras/branches{/branch}","tags_url":"https://api.github.com/repos/keras-team/keras/tags","blobs_url":"https://api.github.com/repos/keras-team/keras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keras-team/keras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keras-team/keras/git/refs{/sha}","trees_url":"https://api.github.com/repos/keras-team/keras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keras-team/keras/statuses/{sha}","languages_url":"https://api.github.com/repos/keras-team/keras/languages","stargazers_url":"https://api.github.com/repos/keras-team/keras/stargazers","contributors_url":"https://api.github.com/repos/keras-team/keras/contributors","subscribers_url":"https://api.github.com/repos/keras-team/keras/subscribers","subscription_url":"https://api.github.com/repos/keras-team/keras/subscription","commits_url":"https://api.github.com/repos/keras-team/keras/commits{/sha}","git_commits_url":"https://api.github.com/repos/keras-team/keras/git/commits{/sha}","comments_url":"https://api.github.com/repos/keras-team/keras/comments{/number}","issue_comment_url":"https://api.github.com/repos/keras-team/keras/issues/comments{/number}","contents_url":"https://api.github.com/repos/keras-team/keras/contents/{+path}","compare_url":"https://api.github.com/repos/keras-team/keras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keras-team/keras/merges","archive_url":"https://api.github.com/repos/keras-team/keras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keras-team/keras/downloads","issues_url":"https://api.github.com/repos/keras-team/keras/issues{/number}","pulls_url":"https://api.github.com/repos/keras-team/keras/pulls{/number}","milestones_url":"https://api.github.com/repos/keras-team/keras/milestones{/number}","notifications_url":"https://api.github.com/repos/keras-team/keras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keras-team/keras/labels{/name}","releases_url":"https://api.github.com/repos/keras-team/keras/releases{/id}","deployments_url":"https://api.github.com/repos/keras-team/keras/deployments","created_at":"2015-03-28T00:35:42Z","updated_at":"2018-04-11T20:57:50Z","pushed_at":"2018-04-11T20:57:40Z","git_url":"git://github.com/keras-team/keras.git","ssh_url":"git@github.com:keras-team/keras.git","clone_url":"https://github.com/keras-team/keras.git","svn_url":"https://github.com/keras-team/keras","homepage":"http://keras.io/","size":10904,"stargazers_count":28131,"watchers_count":28131,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10354,"mirror_url":null,"archived":false,"open_issues_count":1314,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":10354,"open_issues":1314,"watchers":28131,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keras-team/keras/pulls/9715"},"html":{"href":"https://github.com/keras-team/keras/pull/9715"},"issue":{"href":"https://api.github.com/repos/keras-team/keras/issues/9715"},"comments":{"href":"https://api.github.com/repos/keras-team/keras/issues/9715/comments"},"review_comments":{"href":"https://api.github.com/repos/keras-team/keras/pulls/9715/comments"},"review_comment":{"href":"https://api.github.com/repos/keras-team/keras/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keras-team/keras/pulls/9715/commits"},"statuses":{"href":"https://api.github.com/repos/keras-team/keras/statuses/a7a08bd54e4a130fdac6c1135e3d302214e8e63f"}},"author_association":"NONE"}}
{"actor":{"display_login":"fchollet"}}