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

前端 未结 7 1716
余生分开走
余生分开走 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:28

    This seems to be a consistent problem with Keras. I tried to find the lines

    sys.stdout.write('\b' * prev_total_width)

    sys.stdout.write('\r')

    at the Keras/utils/generic_utils.py file and they are (as of the current version) at 258 and 259 accordingly. I commented like 258 but this seems not to resolve the issue. I did manage to make the progress bar work by commenting the line:

    line 303: sys.stdout.write(info)

    It seems as if the info makes the bar too long for the terminal and so it breaks to a new line.

    So I finally resolved the issue. It seems like it was rather simple at the end....

    Just make the terminal wider...

    Note: Tested on Linux Ubuntu 16.04 | Keras Version 2.0.5

提交回复
热议问题