I currently using fastai v0.7 and I am running it on Google Colab. By the way I am implementing the techniques taught in lesson 2, I encountered the following error when running learn.fit(). Does anyone have any idea on the cause?

HBox(children=(IntProgress(value=0, description=‘Epoch’, max=2, >style=ProgressStyle(description_width='initial…

epoch trn_loss val_loss accuracy

AttributeError Traceback (most recent call last)

/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)

55 try:

—> 56 return getattr(obj, method)(*args, **kwds)

57AttributeError: ‘list’ object has no attribute ‘round’

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)

in ()

----> 1 learn.fit(0.01, 2)/usr/local/lib/python3.6/dist-packages/fastai/learner.py in fit(self, lrs, n_cycle, wds, **kwargs)

285 self.sched = None

286 layer_opt = self.get_layer_opt(lrs, wds)

–> 287 return self.fit_gen(self.model, self.data, layer_opt, n_cycle, **kwargs)

288

289 def warm_up(self, lr, wds=None):/usr/local/lib/python3.6/dist-packages/fastai/learner.py in fit_gen(self, model, data, layer_opt, n_cycle, cycle_len, cycle_mult, cycle_save_name, best_save_name, use_clr, use_clr_beta, metrics, callbacks, use_wd_sched, norm_wds, wds_sched_mult, use_swa, swa_start, swa_eval_freq, **kwargs)

232 metrics=metrics, callbacks=callbacks, reg_fn=self.reg_fn, clip=self.clip, fp16=self.fp16,

233 swa_model=self.swa_model if use_swa else None, swa_start=swa_start,

–> 234 swa_eval_freq=swa_eval_freq, **kwargs)

235

236 def get_layer_groups(self): return self.models.get_layer_groups()/usr/local/lib/python3.6/dist-packages/fastai/model.py in fit(model, data, n_epochs, opt, crit, metrics, callbacks, stepper, swa_model, swa_start, swa_eval_freq, **kwargs)

158

159 if epoch == 0: print(layout.format(*names))

–> 160 print_stats(epoch, [debias_loss] + vals)

161 ep_vals = append_stats(ep_vals, epoch, [debias_loss] + vals)

162 if stop: break/usr/local/lib/python3.6/dist-packages/fastai/model.py in print_stats(epoch, values, decimals)

171 def print_stats(epoch, values, decimals=6):

172 layout = “{!s:^10}” + " {!s:10}" * len(values)

–> 173 values = [epoch] + list(np.round(values, decimals))

174 print(layout.format(*values))

175/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py in round_(a, decimals, out)

3380 around : equivalent function; see for details.

3381 “”"

-> 3382 return around(a, decimals=decimals, out=out)

3383

3384/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py in around(a, decimals, out)

3005

3006 “”"

-> 3007 return _wrapfunc(a, ‘round’, decimals=decimals, out=out)

3008

3009/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)

64 # a downstream library like ‘pandas’.

65 except (AttributeError, TypeError):

—> 66 return _wrapit(obj, method, *args, **kwds)

67

68/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py in _wrapit(obj, method, *args, **kwds)

44 except AttributeError:

45 wrap = None

—> 46 result = getattr(asarray(obj), method)(*args, **kwds)

47 if wrap:

48 if not isinstance(result, mu.ndarray):AttributeError: ‘float’ object has no attribute ‘rint’

Belows are my codes:

%reload_ext autoreload

%autoreload 2

%matplotlib inline

from fastai.imports import *

from fastai.transforms import *

from fastai.conv_learner import *

from fastai.model import *

from fastai.dataset import *

from fastai.sgdr import *

from fastai.plots import *

import matplotlib.pyplot as pltPATH = ‘/content/selected_gd_data/’

sz = 224

arch = resnet34

tfms = tfms_from_model(resnet34,

sz,

aug_tfms = transforms_side_on,

max_zoom = 1.1)

import PIL

data = ImageClassifierData.from_paths(PATH,

tfms = tfms,

trn_name = ‘imgtrain’,

val_name = ‘imgval’)

size_d = {k: PIL.Image.open(PATH+k).size for k in data.trn_ds.fnames}

row_sz, col_sz = list(zip(*size_d.values()))

row_sz = np.array(row_sz)

col_sz = np.array(col_sz)

plt.hist(row_sz)

plt.hist(col_sz)def get_data(sz, bs):

tfms = tfms_from_model(arch, sz, aug_tfms = transforms_side_on, max_zoom = 1.1)

data = ImageClassifierData.from_paths(PATH,

tfms = tfms,

trn_name = ‘imgtrain’,

val_name = ‘imgval’,

bs = bs)

return data if sz>300 else data.resize(340, ‘tmp’)

data = get_data(sz, 64)learn = ConvLearner.pretrained(arch, data, precompute = True)

lrf = learn.lr_find(1e-6,1e1)

learn.sched.plot_lr()

learn.sched.plot()

learn.fit(0.01, 2)