{"action":"created","comment":{"url":"https://api.github.com/repos/keras-team/keras/pulls/comments/181130788","pull_request_review_id":111682386,"id":181130788,"diff_hunk":"@@ -856,7 +864,50 @@ def on_epoch_end(self, epoch, logs=None):\n                     summary_str = result[0]\n                     self.writer.add_summary(summary_str, epoch)\n                     i += self.batch_size\n+        if self.validation_generator and self.histogram_freq:\n+            assert self.validation_steps is not None\n+            if epoch % self.histogram_freq == 0:\n+\n+                tensors = (self.model.inputs +\n+                           self.model.targets +\n+                           self.model.sample_weights)\n \n+                i = 0\n+                while i < self.validation_steps:\n+                    generator_output = next(self.validation_generator)\n+                    if len(generator_output) == 2:\n+                        x, y = generator_output\n+                        sample_weight = None\n+                    elif len(generator_output) == 3:\n+                        x, y, sample_weight = generator_output\n+\n+                    if isinstance(x, list):\n+                        batch_size = x[0].shape[0]\n+                    elif isinstance(x, dict):\n+                        batch_size = list(x.values())[0].shape[0]\n+                    else:\n+                        batch_size = x.shape[0]\n+                    if batch_size == 0:\n+                        raise ValueError('Received an empty batch. '\n+                                         'Batches should at least contain one '\n+                                         'item.')\n+                    x, y, sample_weight = self.model._standardize_user_data(\n+                        x, y, sample_weight=sample_weight,\n+                        batch_size=batch_size)\n+                    batch_val = x + y + sample_weight\n+                    if not len(batch_val) == len(tensors):\n+                        raise ValueError('validation_data generator\\'s output '","path":"keras/callbacks.py","position":76,"original_position":76,"commit_id":"c50d11e138f100807b36c8bb4dbcbb364df2c63b","original_commit_id":"c50d11e138f100807b36c8bb4dbcbb364df2c63b","user":{"login":"DavidAriel","id":8448791,"avatar_url":"https://avatars3.githubusercontent.com/u/8448791?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidAriel","html_url":"https://github.com/DavidAriel","followers_url":"https://api.github.com/users/DavidAriel/followers","following_url":"https://api.github.com/users/DavidAriel/following{/other_user}","gists_url":"https://api.github.com/users/DavidAriel/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidAriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidAriel/subscriptions","organizations_url":"https://api.github.com/users/DavidAriel/orgs","repos_url":"https://api.github.com/users/DavidAriel/repos","events_url":"https://api.github.com/users/DavidAriel/events{/privacy}","received_events_url":"https://api.github.com/users/DavidAriel/received_events","type":"User","site_admin":false},"body":"I copied this assertion from ~40 lines obove, line 861:\r\n`len(batch_val) == len(tensors)`\r\nthat assertion is also done per batch in the part of code that handles preloaded validaton data (i.e. not from a generator).\r\nThe user error this assertion (and so do my assertion) meant to catch is when the user given validation generator yields the wrong number of objects, so it cannot be fed into the model.\r\n\r\nIf you don't agree with this assertion, I would suggest remove the previous one from line 861 as well.","created_at":"2018-04-12T15:47:29Z","updated_at":"2018-04-12T15:47:30Z","html_url":"https://github.com/keras-team/keras/pull/9796#discussion_r181130788","pull_request_url":"https://api.github.com/repos/keras-team/keras/pulls/9796","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/keras-team/keras/pulls/comments/181130788"},"html":{"href":"https://github.com/keras-team/keras/pull/9796#discussion_r181130788"},"pull_request":{"href":"https://api.github.com/repos/keras-team/keras/pulls/9796"}},"in_reply_to_id":180912495},"pull_request":{"url":"https://api.github.com/repos/keras-team/keras/pulls/9796","id":178336878,"html_url":"https://github.com/keras-team/keras/pull/9796","diff_url":"https://github.com/keras-team/keras/pull/9796.diff","patch_url":"https://github.com/keras-team/keras/pull/9796.patch","issue_url":"https://api.github.com/repos/keras-team/keras/issues/9796","number":9796,"state":"open","locked":false,"title":"TensorBoard visualization support validation generator","user":{"login":"DavidAriel","id":8448791,"avatar_url":"https://avatars3.githubusercontent.com/u/8448791?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidAriel","html_url":"https://github.com/DavidAriel","followers_url":"https://api.github.com/users/DavidAriel/followers","following_url":"https://api.github.com/users/DavidAriel/following{/other_user}","gists_url":"https://api.github.com/users/DavidAriel/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidAriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidAriel/subscriptions","organizations_url":"https://api.github.com/users/DavidAriel/orgs","repos_url":"https://api.github.com/users/DavidAriel/repos","events_url":"https://api.github.com/users/DavidAriel/events{/privacy}","received_events_url":"https://api.github.com/users/DavidAriel/received_events","type":"User","site_admin":false},"body":"I saw closed PRs #4358 #4386 for issues #3358 and #8554 not sure why they are not merged... \r\nAdded my own fix, which is basically taking the code that handles preloaded validation data and reusing it for when a validation generator is used.","created_at":"2018-03-29T13:58:30Z","updated_at":"2018-04-12T15:47:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c472bf062aa7b32380568cad6e661fca971cacb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":808058525,"url":"https://api.github.com/repos/keras-team/keras/labels/Reviewers%20wanted","name":"Reviewers wanted","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/keras-team/keras/pulls/9796/commits","review_comments_url":"https://api.github.com/repos/keras-team/keras/pulls/9796/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/9796/comments","statuses_url":"https://api.github.com/repos/keras-team/keras/statuses/c50d11e138f100807b36c8bb4dbcbb364df2c63b","head":{"label":"DavidAriel:Tensorboard_histogram_for_validation_generators","ref":"Tensorboard_histogram_for_validation_generators","sha":"c50d11e138f100807b36c8bb4dbcbb364df2c63b","user":{"login":"DavidAriel","id":8448791,"avatar_url":"https://avatars3.githubusercontent.com/u/8448791?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidAriel","html_url":"https://github.com/DavidAriel","followers_url":"https://api.github.com/users/DavidAriel/followers","following_url":"https://api.github.com/users/DavidAriel/following{/other_user}","gists_url":"https://api.github.com/users/DavidAriel/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidAriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidAriel/subscriptions","organizations_url":"https://api.github.com/users/DavidAriel/orgs","repos_url":"https://api.github.com/users/DavidAriel/repos","events_url":"https://api.github.com/users/DavidAriel/events{/privacy}","received_events_url":"https://api.github.com/users/DavidAriel/received_events","type":"User","site_admin":false},"repo":{"id":127288669,"name":"keras","full_name":"DavidAriel/keras","owner":{"login":"DavidAriel","id":8448791,"avatar_url":"https://avatars3.githubusercontent.com/u/8448791?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidAriel","html_url":"https://github.com/DavidAriel","followers_url":"https://api.github.com/users/DavidAriel/followers","following_url":"https://api.github.com/users/DavidAriel/following{/other_user}","gists_url":"https://api.github.com/users/DavidAriel/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidAriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidAriel/subscriptions","organizations_url":"https://api.github.com/users/DavidAriel/orgs","repos_url":"https://api.github.com/users/DavidAriel/repos","events_url":"https://api.github.com/users/DavidAriel/events{/privacy}","received_events_url":"https://api.github.com/users/DavidAriel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DavidAriel/keras","description":"Deep Learning for humans","fork":true,"url":"https://api.github.com/repos/DavidAriel/keras","forks_url":"https://api.github.com/repos/DavidAriel/keras/forks","keys_url":"https://api.github.com/repos/DavidAriel/keras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DavidAriel/keras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DavidAriel/keras/teams","hooks_url":"https://api.github.com/repos/DavidAriel/keras/hooks","issue_events_url":"https://api.github.com/repos/DavidAriel/keras/issues/events{/number}","events_url":"https://api.github.com/repos/DavidAriel/keras/events","assignees_url":"https://api.github.com/repos/DavidAriel/keras/assignees{/user}","branches_url":"https://api.github.com/repos/DavidAriel/keras/branches{/branch}","tags_url":"https://api.github.com/repos/DavidAriel/keras/tags","blobs_url":"https://api.github.com/repos/DavidAriel/keras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DavidAriel/keras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DavidAriel/keras/git/refs{/sha}","trees_url":"https://api.github.com/repos/DavidAriel/keras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DavidAriel/keras/statuses/{sha}","languages_url":"https://api.github.com/repos/DavidAriel/keras/languages","stargazers_url":"https://api.github.com/repos/DavidAriel/keras/stargazers","contributors_url":"https://api.github.com/repos/DavidAriel/keras/contributors","subscribers_url":"https://api.github.com/repos/DavidAriel/keras/subscribers","subscription_url":"https://api.github.com/repos/DavidAriel/keras/subscription","commits_url":"https://api.github.com/repos/DavidAriel/keras/commits{/sha}","git_commits_url":"https://api.github.com/repos/DavidAriel/keras/git/commits{/sha}","comments_url":"https://api.github.com/repos/DavidAriel/keras/comments{/number}","issue_comment_url":"https://api.github.com/repos/DavidAriel/keras/issues/comments{/number}","contents_url":"https://api.github.com/repos/DavidAriel/keras/contents/{+path}","compare_url":"https://api.github.com/repos/DavidAriel/keras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DavidAriel/keras/merges","archive_url":"https://api.github.com/repos/DavidAriel/keras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DavidAriel/keras/downloads","issues_url":"https://api.github.com/repos/DavidAriel/keras/issues{/number}","pulls_url":"https://api.github.com/repos/DavidAriel/keras/pulls{/number}","milestones_url":"https://api.github.com/repos/DavidAriel/keras/milestones{/number}","notifications_url":"https://api.github.com/repos/DavidAriel/keras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DavidAriel/keras/labels{/name}","releases_url":"https://api.github.com/repos/DavidAriel/keras/releases{/id}","deployments_url":"https://api.github.com/repos/DavidAriel/keras/deployments","created_at":"2018-03-29T12:32:07Z","updated_at":"2018-03-29T13:35:13Z","pushed_at":"2018-04-09T10:07:49Z","git_url":"git://github.com/DavidAriel/keras.git","ssh_url":"git@github.com:DavidAriel/keras.git","clone_url":"https://github.com/DavidAriel/keras.git","svn_url":"https://github.com/DavidAriel/keras","homepage":"http://keras.io/","size":10893,"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":"f7afc73780ffe89abd8dd08ebd815cbcf56720ee","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-12T15:27:39Z","pushed_at":"2018-04-12T13:34:20Z","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":10931,"stargazers_count":28171,"watchers_count":28171,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10363,"mirror_url":null,"archived":false,"open_issues_count":1323,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":10363,"open_issues":1323,"watchers":28171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keras-team/keras/pulls/9796"},"html":{"href":"https://github.com/keras-team/keras/pull/9796"},"issue":{"href":"https://api.github.com/repos/keras-team/keras/issues/9796"},"comments":{"href":"https://api.github.com/repos/keras-team/keras/issues/9796/comments"},"review_comments":{"href":"https://api.github.com/repos/keras-team/keras/pulls/9796/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/9796/commits"},"statuses":{"href":"https://api.github.com/repos/keras-team/keras/statuses/c50d11e138f100807b36c8bb4dbcbb364df2c63b"}},"author_association":"NONE"}}
{"actor":{"display_login":"DavidAriel"}}