{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/7699","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/7699/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/7699/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/7699/events","html_url":"https://github.com/fchollet/keras/issues/7699","id":251628194,"number":7699,"title":"I am able to run callbacks using model.fit. The corresponding code is                '' model.fit(X_train, Y_train,               batch_size=batch_size,               nb_epoch=nb_epoch,               shuffle=True,               verbose=1,              validation_data=(X_valid, Y_valid),callbacks=[save_model,          early_stopping,csv_logger,qwk]'' . How to use callbacks with model.fit_generator? It is showing error 'fit_generator() takes at least 3 arguments (6 given).' The corresonding code is                                            '' model.fit_generator(datagen.flow(X_train, Y_train, batch_size=batch_size,shuffle=True,save_to_dir=aug_path, save_prefix='aug'),                     nb_epoch=nb_epoch,verbose=1,                     validation_data=(X_valid, Y_valid),                     callbacks=[save_model,          early_stopping,csv_logger,qwk])''","user":{"login":"Niladri365","id":22894436,"avatar_url":"https://avatars2.githubusercontent.com/u/22894436?v=4","gravatar_id":"","url":"https://api.github.com/users/Niladri365","html_url":"https://github.com/Niladri365","followers_url":"https://api.github.com/users/Niladri365/followers","following_url":"https://api.github.com/users/Niladri365/following{/other_user}","gists_url":"https://api.github.com/users/Niladri365/gists{/gist_id}","starred_url":"https://api.github.com/users/Niladri365/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Niladri365/subscriptions","organizations_url":"https://api.github.com/users/Niladri365/orgs","repos_url":"https://api.github.com/users/Niladri365/repos","events_url":"https://api.github.com/users/Niladri365/events{/privacy}","received_events_url":"https://api.github.com/users/Niladri365/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-21T11:19:12Z","updated_at":"2017-08-26T06:35:08Z","closed_at":null,"body":"Please make sure that the boxes below are checked before you submit your issue. If your issue is an implementation question, please ask your question on [StackOverflow](http://stackoverflow.com/questions/tagged/keras) or [join the Keras Slack channel](https://keras-slack-autojoin.herokuapp.com/) and ask there instead of filing a GitHub issue.\r\n\r\nThank you!\r\n\r\n- [ ] Check that you are up-to-date with the master branch of Keras. You can update with:\r\npip install git+git://github.com/fchollet/keras.git --upgrade --no-deps\r\n\r\n- [x] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found [here](https://www.tensorflow.org/get_started/os_setup).\r\n\r\n- [ ] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with:\r\npip install git+git://github.com/Theano/Theano.git --upgrade --no-deps\r\n\r\n- [x] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).\r\n"},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/325093922","html_url":"https://github.com/fchollet/keras/issues/7699#issuecomment-325093922","issue_url":"https://api.github.com/repos/fchollet/keras/issues/7699","id":325093922,"user":{"login":"netrapathak","id":13345297,"avatar_url":"https://avatars0.githubusercontent.com/u/13345297?v=4","gravatar_id":"","url":"https://api.github.com/users/netrapathak","html_url":"https://github.com/netrapathak","followers_url":"https://api.github.com/users/netrapathak/followers","following_url":"https://api.github.com/users/netrapathak/following{/other_user}","gists_url":"https://api.github.com/users/netrapathak/gists{/gist_id}","starred_url":"https://api.github.com/users/netrapathak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netrapathak/subscriptions","organizations_url":"https://api.github.com/users/netrapathak/orgs","repos_url":"https://api.github.com/users/netrapathak/repos","events_url":"https://api.github.com/users/netrapathak/events{/privacy}","received_events_url":"https://api.github.com/users/netrapathak/received_events","type":"User","site_admin":false},"created_at":"2017-08-26T06:35:08Z","updated_at":"2017-08-26T06:35:08Z","body":"Below is the code of how I used callbacks with model.fit_generator:\r\n\r\nearlystop = EarlyStopping(monitor='val_acc', patience=50, verbose=1, mode='auto')\r\ncheck = ModelCheckpoint(model_filename,\r\n                        monitor='val_acc',\r\n                        verbose=1,\r\n                        save_best_only=True,\r\n                        mode='auto')\r\nhistory = History()\r\ntensorboard = TensorBoard(log_dir='./logs', write_graph=True, write_images=True)\r\n\r\n# Fit the model on the batches generated by datagen.flow().\r\nmodel.fit_generator(train_generator,\r\n                    steps_per_epoch=(nb_train_samples/batch_size),\r\n                    epochs=epochs,\r\n                    validation_data=validation_generator,\r\n                    validation_steps=(nb_validation_samples/batch_size),\r\n                    callbacks=[earlystop,check,history,tensorboard],\r\nverbose=1)"}}
{"actor":{"display_login":"netrapathak"}}