Colab verbose warnings

I ran the lesson 1 codes on Colab. The codes work but I got many lines of verbose warnings whenever it trains. For example,

learn.fit_one_cycle(2, max_lr=slice(1e-6,1e-4))

got this warning repeated many times over:

/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py:3000: UserWarning: The default behavior for interpolate/upsample with float scale_factor changed in 1.6.0 to align with other frameworks/libraries, and uses scale_factor directly, instead of relying on the computed output size. If you wish to keep the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details.

And I didn’t get the summary table

epoch train_loss valid_loss error_rate
|1 |0.242544| 0.208489| 0.067659|
|2 |0.206940| 0.204482| 0.062246|

I want to know how to fix it. Thanks!

You can run the following to suppress the warnings:

import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="torch.nn.functional")

Thanks a lot! Will try it and let you know. My colab is running very sloooooow. For the pets.ipynb, running learn.fit_one_cycle(3) (I used 3 instead of 4) has been taking more than 30 minutes.

Thanks again @zerotosingularity. The part of category=UserWarning doesn’t work for me, so I trimmed it down to warnings.filterwarnings(“ignore”), which can be too general but works so far.

I had the same experience lately, training on the free version takes a long time…

Glad you gave it working!