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

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

    I had a similar issue, but have not had the time to investigate it further. The problem seems to be related to the class Progbar in generic_utils.py of keras, see link, and perhaps Python >= 3.3.

    The following lines are found in the update function of the class:

    Line 107: sys.stdout.write('\b' * prev_total_width)
    Line 108: sys.stdout.write('\r')

    I simply removed line 107 as a quick fix, so instead of backspacing the previous line then performing a shift to the beginning of the line, I only perform the shift. I guess there is some better ways than altering the source code though.

提交回复
热议问题