Autokeras: tqdm doesn't work on google colab

Created on 12 Nov 2018  路  6Comments  路  Source: keras-team/autokeras

Bug Description

As mentioned by @shyamalschandra.

According to tqdm issue#558
tqdm.notebook can't work on Google Colab due to the lack of ipywidgets

Reproducing Steps

Steps to reproduce the behavior:

  • Step 1: pip3 install autokeras on google colab
  • Step 2: run example/mnist.py by coping and pasting the code in Google Colab.

Expected Behavior

Should be working without error

Setup Details

Include the details about the versions of:

  • OS type and version: Google Colab
  • Python: 3.6
  • autokeras: 0.2.18
  • scikit-learn: 0.19.1
  • numpy: 1.14.5
  • keras: 2.2.2
  • scipy:
  • tensorflow: 1.10.0
  • pytorch: 0.4.1
  • tqdm: 4.25.0

Additional context

Could be solved by replacing

from tqdm.autonotebook import tqdm

to

from tqdm import tqdm

However, the final progress bar will remain on the terminal

bug report

Most helpful comment

Is it usable on Colab now? It seems to mess with it still.

All 6 comments

Hi, I am a tqdm developer and am trying to address this problem.
I have a PR which has minimal function https://github.com/tqdm/tqdm/pull/640
Could you please try it and give me some feedbacks? (eg. If it is enough for you).

Hi @chengs, thanks for the great work. With the patch, tqdm should be able to support tqdm.notebook on Google Colab, Is my understanding correct?
I've tried our original usage of tqdm:

from tqdm.autonotebook import tqdm
progress_bar = tqdm(total=len(
    desc='Epoch-'
    + str(self.current_epoch)
    + ', Current Metric - '
    + str(self.current_metric_value),
    file=sys.stdout,
    leave=False,
    ncols=100,
    position=0,
    unit=' batch')

Still I got the same error code.

@tl-yang Yes, although it is hard to implement ALL the tqdm features since there is no ipywidgets support, my plan is to implement a ugly but workable progressbar without the support of ipywidgets.

I will check your case and try to make it work.

@chengs Do you have any update on this?

I implement the basic function. Please see the demo here. https://colab.research.google.com/drive/12QXaI5ZAiQJfK-19HVl8fyjyh79B-TMf

The PR is waiting for review yet, so I think it may take weeks until my PR is merged into master.

Is it usable on Colab now? It seems to mess with it still.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SunYanCN picture SunYanCN  路  5Comments

mark-watson picture mark-watson  路  5Comments

vincent-hui picture vincent-hui  路  5Comments

ikscapes picture ikscapes  路  3Comments

takeofuture picture takeofuture  路  3Comments