7

When running keras model inside Jupyter notebook with "verbose=1" option, I started getting not single line progress status updates as before, but a flood of status lines updated at batch. See attached picture. Restarting jupyter or the browser is not helping. Jupyter notebook server is: 5.6.0, keras is 2.2.2, Python is Python 3.6.5 Please help.

cell content:

history = model.fit(x=train_df_scaled, y=train_labels, batch_size=BATCH_SIZE, epochs=EPOCHS, verbose=1, validation_data=(validation_df_scaled, validation_labels), shuffle=True)

output flood example: (it is thousands of lines like this)

loss: 217.5794 - mean_absolute_error: 11.166 - ETA: 32:42 - loss: 216.9500 - mean_absolute_error: 11.165 - ETA: 32:21 - loss: 216.6378 - mean_absolute_error: 11.164 - ETA: 32:00 - loss: 216.0345 - mean_absolute_error: 11.164 - ETA: 31:41 - loss: 215.6621 - mean_absolute_error: 11.166 - ETA: 31:21 - loss: 215.4639 - mean_absolute_error: 11.171 - ETA: 31:02 - loss: 215.1654 - mean_absolute_error: 11.173 - ETA: 30:44 - loss: 214.6583 - mean_absolute_error: 11.169 - ETA: 30:27 - loss: 213.8844 - mean_absolute_error: 11.164 - ETA: 30:10 - loss: 213.3308 - mean_absolute_error: 11.163 - ETA: 29:54 - loss: 213.1179 - mean_absolute_error: 11.167 - ETA: 29:37 - loss: 212.8138 - mean_absolute_error: 11.169 - ETA: 29:25 - loss: 212.7157 - mean_absolute_error: 11.174 - ETA: 29:11 - loss: 212.5421 - mean_absolute_error: 11.177 - ETA: 28:56 - loss: 212.1867 - mean_absolute_error: 11.178 - ETA: 28:42 - loss: 211.8032 - mean_absolute_error: 11.180 - ETA: 28:28 - loss: 211.4079 - mean_absolute_error: 11.179 - ETA: 28:15 - loss: 211.2733 - mean_absolute_error: 11.182 - ETA: 28:02 - loss: 210.8588 - mean_absolute_error: 11.179 - ETA: 27:50 - loss: 210.4498 - mean_absolute_error: 11.178 - ETA: 27:37 - loss: 209.9327 - mean_absolute_error: 11.176 - ETA: 27:

Poe Dator
  • 4,535
  • 2
  • 14
  • 35
  • Eh ... you forgot to ask a question. Also if you don't want verbose output, maybe don't set verbose to 1. – meissner_ Sep 21 '18 at 11:59

3 Answers3

4

After a few tests I found that the error is related to tqdm import. Tqdm was used in a piece of code which was later rewritten withoout it. Even though I was not using tqdm in this notebook, just having it imported affected the keras output. To fix it I just commented out this line: from tqdm import tqdm and everything went fine, with nice keras progress bars. Not sure how exactly it conflicted with keras though...

Poe Dator
  • 4,535
  • 2
  • 14
  • 35
1

verbose=2 should be used for interactive outputs.

Martin Krämer
  • 567
  • 3
  • 17
  • I tried _verbose = 2_ but it only shows the epoch number, no loss data or ETA. What puzzles me is that just until 2 days ago I was getting normal input. There were no major changes in my software - don't know what broke. – Poe Dator Sep 21 '18 at 12:05
  • Sounds like a problem with your installation (most likely of Jupyter or some browser issue). Generally the output should be identical, but overwriting the line instead of writing it one by one. – Martin Krämer Sep 21 '18 at 12:11
1

Two things I would recommend:

  • Try restarting Jupyter Notebook server.
  • Try different browser other than what you're using; perhaps your browser got some update and it's breaking stuff! (usually, chrome is bad with notebooks!)
Snehal
  • 748
  • 1
  • 7
  • 25