在Jupyter笔记本上,我可以创建可以像这样更新的命名输出:
from IPython.display import HTML, display
import time
def progress(value, max=100):
return HTML("""
<progress
value='{value}'
max='{max}',
style='width: 100%'
>
{value}
</progress>
""".format(value=value, max=max))
out = display(progress(0, 100), display_id=True)
for ii in range(101):
time.sleep(0.02)
out.update(progress(ii, 100))
Run Code Online (Sandbox Code Playgroud)
而在colab中它不会更新进度条.
你是如何在colab中做到这一点的?