fastai / fastprogress

Simple and flexible progress bar for Jupyter Notebook and console
Apache License 2.0
1.08k stars 105 forks source link

Progress Bar on Pycharm? #61

Closed bomcon123456 closed 4 years ago

bomcon123456 commented 4 years ago

Hi I'm currently using Pycharm to run remote jupyter server, but when I'm training (using fastai2), the progress bar simply grey and not running at all (the train still ran and finished) Thank you! ảnh

sgugger commented 4 years ago

It seem simple widgets don't work in Pycharm so you should use the console behavior:

from fastprogress.fastprogress import force_console_behavior
master_bar, progress_bar = force_console_behavior()
aljungberg commented 2 years ago

Just for future reference, the reason PyCharm output with the regular progress bar doesn't work is that self.out.update does nothing in PyCharm. I found a number of issues in the PyCharm bug tracker which seem to confirm that progressively updating display output using display_handle = display(..., display_id=True) and display_handle.update() has no effect.

You can render the HTML just fine like this:

from IPython.display import clear_output, display, HTML
display(HTML(mb.html_code))

where mb is the master bar. This renders the correct output -- but there seems to be no way to make it interactive/animated such that it updates over time in PyCharm.

One of the jetbrains bug reports: https://youtrack.jetbrains.com/issue/DS-3383/IPythondisplay-update-problem

Screenshot 2022-08-18 at 21 35 29