{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/2560","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/2560/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/2560/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/2560/events","html_url":"https://github.com/fchollet/keras/issues/2560","id":151995142,"number":2560,"title":"Race condition in fit_generator() when generator exits","user":{"login":"sehugg","id":84127,"avatar_url":"https://avatars.githubusercontent.com/u/84127?v=3","gravatar_id":"","url":"https://api.github.com/users/sehugg","html_url":"https://github.com/sehugg","followers_url":"https://api.github.com/users/sehugg/followers","following_url":"https://api.github.com/users/sehugg/following{/other_user}","gists_url":"https://api.github.com/users/sehugg/gists{/gist_id}","starred_url":"https://api.github.com/users/sehugg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sehugg/subscriptions","organizations_url":"https://api.github.com/users/sehugg/orgs","repos_url":"https://api.github.com/users/sehugg/repos","events_url":"https://api.github.com/users/sehugg/events{/privacy}","received_events_url":"https://api.github.com/users/sehugg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-30T00:49:04Z","updated_at":"2016-04-30T13:43:55Z","closed_at":null,"body":"Users of `generator_queue()` like `fit_generator()` have a race condition when the generator exits after generating a number of samples equal to or slightly greater than `samples_per_epoch`. The function will occasionally fetch `None` from the queue instead of the final elements."},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/215964030","html_url":"https://github.com/fchollet/keras/issues/2560#issuecomment-215964030","issue_url":"https://api.github.com/repos/fchollet/keras/issues/2560","id":215964030,"user":{"login":"carlthome","id":1595907,"avatar_url":"https://avatars.githubusercontent.com/u/1595907?v=3","gravatar_id":"","url":"https://api.github.com/users/carlthome","html_url":"https://github.com/carlthome","followers_url":"https://api.github.com/users/carlthome/followers","following_url":"https://api.github.com/users/carlthome/following{/other_user}","gists_url":"https://api.github.com/users/carlthome/gists{/gist_id}","starred_url":"https://api.github.com/users/carlthome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlthome/subscriptions","organizations_url":"https://api.github.com/users/carlthome/orgs","repos_url":"https://api.github.com/users/carlthome/repos","events_url":"https://api.github.com/users/carlthome/events{/privacy}","received_events_url":"https://api.github.com/users/carlthome/received_events","type":"User","site_admin":false},"created_at":"2016-04-30T13:43:55Z","updated_at":"2016-04-30T13:43:55Z","body":"The generator is expected to loop indefinitely according to the documentation so if you by _\"when the generator exits\"_ mean that it's finished and that another next() call will result in a `StopIteration` being raised, then this is not a necessary fix."}}