{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/2110","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/2110/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/2110/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/2110/events","html_url":"https://github.com/fchollet/keras/issues/2110","id":144134735,"number":2110,"title":"model.fit ValueError: I/O operation on closed file","user":{"login":"panw","id":857822,"avatar_url":"https://avatars.githubusercontent.com/u/857822?v=3","gravatar_id":"","url":"https://api.github.com/users/panw","html_url":"https://github.com/panw","followers_url":"https://api.github.com/users/panw/followers","following_url":"https://api.github.com/users/panw/following{/other_user}","gists_url":"https://api.github.com/users/panw/gists{/gist_id}","starred_url":"https://api.github.com/users/panw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panw/subscriptions","organizations_url":"https://api.github.com/users/panw/orgs","repos_url":"https://api.github.com/users/panw/repos","events_url":"https://api.github.com/users/panw/events{/privacy}","received_events_url":"https://api.github.com/users/panw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-03-29T02:18:04Z","updated_at":"2016-10-05T19:26:25Z","closed_at":null,"body":"Any idea what could be causing this error? I've been trying to solve this for a week. Thanks in advance.\r\n\r\n```\r\nTrain on 60816 samples, validate on 15204 samples\r\nEpoch 1/20\r\n60816/60816 [==============================] - 19s - loss: 0.1665 - acc: 0.9597 - val_loss: 0.1509 - val_acc: 0.9605\r\nEpoch 2/20\r\n31200/60816 [==============>...............] - ETA: 8s - loss: 0.1583 - acc: 0.9600\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-4-e3590f9fe5e6> in <module>()\r\n     16 \r\n     17 my_model = model.fit(train_x, train_y, batch_size=100, nb_epoch=20,                       \r\n---> 18                      show_accuracy=True, verbose=1, validation_data=(test_x, test_y))\r\n     19 score = model.evaluate(test_x, test_y, show_accuracy=True, verbose=0)\r\n     20 print('Test loss:', score[0])\r\n\r\n/usr/local/lib/python2.7/dist-packages/keras/models.pyc in fit(self, X, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, show_accuracy, class_weight, sample_weight)\r\n    644                          verbose=verbose, callbacks=callbacks,\r\n    645                          val_f=val_f, val_ins=val_ins,\r\n--> 646                          shuffle=shuffle, metrics=metrics)\r\n    647 \r\n    648     def predict(self, X, batch_size=128, verbose=0):\r\n\r\n/usr/local/lib/python2.7/dist-packages/keras/models.pyc in _fit(self, f, ins, out_labels, batch_size, nb_epoch, verbose, callbacks, val_f, val_ins, shuffle, metrics)\r\n    284                     batch_logs[l] = o\r\n    285 \r\n--> 286                 callbacks.on_batch_end(batch_index, batch_logs)\r\n    287 \r\n    288                 epoch_logs = {}\r\n\r\n/usr/local/lib/python2.7/dist-packages/keras/callbacks.pyc in on_batch_end(self, batch, logs)\r\n     58         t_before_callbacks = time.time()\r\n     59         for callback in self.callbacks:\r\n---> 60             callback.on_batch_end(batch, logs)\r\n     61         self._delta_ts_batch_end.append(time.time() - t_before_callbacks)\r\n     62         delta_t_median = np.median(self._delta_ts_batch_end)\r\n\r\n/usr/local/lib/python2.7/dist-packages/keras/callbacks.pyc in on_batch_end(self, batch, logs)\r\n    168         # will be handled by on_epoch_end\r\n    169         if self.verbose and self.seen < self.params['nb_sample']:\r\n--> 170             self.progbar.update(self.seen, self.log_values)\r\n    171 \r\n    172     def on_epoch_end(self, epoch, logs={}):\r\n\r\n/usr/local/lib/python2.7/dist-packages/keras/utils/generic_utils.pyc in update(self, current, values)\r\n     59             prev_total_width = self.total_width\r\n     60             sys.stdout.write(\"\\b\" * prev_total_width)\r\n---> 61             sys.stdout.write(\"\\r\")\r\n     62 \r\n     63             numdigits = int(np.floor(np.log10(self.target))) + 1\r\n\r\n/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.pyc in write(self, string)\r\n    315 \r\n    316             is_child = (not self._is_master_process())\r\n--> 317             self._buffer.write(string)\r\n    318             if is_child:\r\n    319                 # newlines imply flush in subprocesses\r\n\r\nValueError: I/O operation on closed file\r\n```"},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/251773758","html_url":"https://github.com/fchollet/keras/issues/2110#issuecomment-251773758","issue_url":"https://api.github.com/repos/fchollet/keras/issues/2110","id":251773758,"user":{"login":"vijaymanikandan","id":11545453,"avatar_url":"https://avatars.githubusercontent.com/u/11545453?v=3","gravatar_id":"","url":"https://api.github.com/users/vijaymanikandan","html_url":"https://github.com/vijaymanikandan","followers_url":"https://api.github.com/users/vijaymanikandan/followers","following_url":"https://api.github.com/users/vijaymanikandan/following{/other_user}","gists_url":"https://api.github.com/users/vijaymanikandan/gists{/gist_id}","starred_url":"https://api.github.com/users/vijaymanikandan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijaymanikandan/subscriptions","organizations_url":"https://api.github.com/users/vijaymanikandan/orgs","repos_url":"https://api.github.com/users/vijaymanikandan/repos","events_url":"https://api.github.com/users/vijaymanikandan/events{/privacy}","received_events_url":"https://api.github.com/users/vijaymanikandan/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T19:26:25Z","updated_at":"2016-10-05T19:26:25Z","body":"I had this problem too and setting verbose=0 in the argument of model.fit() seems to have fixed it. "}}
{"actor":{"display_login":"vijaymanikandan"}}