Keras verbose training progress bar writing a new line on each batch issue

前端 未结 7 1714
余生分开走
余生分开走 2020-12-09 09:09

running a Dense feed-forward neural net in Keras. there are class_weights for two outputs, and sample_weights for a third output. fore some reason it prints the progress ver

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 09:18

    Import the library:

    from tqdm.keras import TqdmCallback
    

    Specify using tqdm library:

    model.fit(xs, ys, epochs=10000, verbose=0, callbacks=[TqdmCallback(verbose=1)])
    

    Result:

    100%|██████████████| 10000/10000 [01:34<00:00, 105.57epoch/s, loss=1.56e+3]
     29%|███▌          |  2891/10000 [00:28<01:05, 108.02epoch/s, loss=1.57e+3]
    

    For my case, verbose=1 is what really works for me. My answer is based on casper.dcl's answer.

提交回复
热议问题