Keras Model.fit Verbose Formatting

后端 未结 2 974
情书的邮戳
情书的邮戳 2021-02-04 11:37

I\'m running Keras model.fit() in Jupyter notebook, and the output is very messy if verbose is set to 1:

    Train on 6400 samples, validate on 800 samples
    E         


        
2条回答
  •  名媛妹妹
    2021-02-04 12:29

    You can try the Keras-adapted version of the TQDM progress bar library.

    • The original TQDM library: https://github.com/tqdm/tqdm
    • The Keras version of TQDM: https://github.com/bstriner/keras-tqdm

    The usage instructions can be brought down to:

    1. install e.g. per pip install keras-tqdm (stable) or pip install git+https://github.com/bstriner/keras-tqdm.git (for latest dev-version)

    2. import the callback function with from keras_tqdm import TQDMNotebookCallback

    3. run Keras' fit or fit_generator with verbose=0 or verbose=2 settings, but with a callback to the imported TQDMNotebookCallback, e.g. model.fit(X_train, Y_train, verbose=0, callbacks=[TQDMNotebookCallback()])

    The result:

提交回复
热议问题