Problems running "Lesson 6: pets revisited"


#1

When I run Lesson 6 on latest master (d4d38621cfbbeb6f7c87fc03cf0d0a1c57bb4451), I get the error:


TypeError Traceback (most recent call last)
in
----> 1 learn.fit_one_cycle(3, slice(1e-2), pct_start=0.8)

~/jupyter/repo-fastai-v1/fastai/train.py in fit_one_cycle(learn, cyc_len, max_lr, moms, div_factor, pct_start, wd, callbacks, **kwargs)
19 callbacks.append(OneCycleScheduler(learn, max_lr, moms=moms, div_factor=div_factor,
20 pct_start=pct_start, **kwargs))
—> 21 learn.fit(cyc_len, max_lr, wd=wd, callbacks=callbacks)
22
23 def lr_find(learn:Learner, start_lr:Floats=1e-7, end_lr:Floats=10, num_it:int=100, stop_div:bool=True, **kwargs:Any):

~/jupyter/repo-fastai-v1/fastai/basic_train.py in fit(self, epochs, lr, wd, callbacks)
164 callbacks = [cb(self) for cb in self.callback_fns] + listify(callbacks)
165 fit(epochs, self.model, self.loss_func, opt=self.opt, data=self.data, metrics=self.metrics,
–> 166 callbacks=self.callbacks+callbacks)
167
168 def create_opt(self, lr:Floats, wd:Floats=0.)->None:

~/jupyter/repo-fastai-v1/fastai/basic_train.py in fit(epochs, model, loss_func, opt, data, callbacks, metrics)
72 cb_handler = CallbackHandler(callbacks, metrics)
73 pbar = master_bar(range(epochs))
—> 74 cb_handler.on_train_begin(epochs, pbar=pbar, metrics=metrics)
75
76 exception=False

~/jupyter/repo-fastai-v1/fastai/callback.py in on_train_begin(self, epochs, pbar, metrics)
193 self.state_dict[‘n_epochs’],self.state_dict[‘pbar’],self.state_dict[‘metrics’] = epochs,pbar,metrics
194 names = [(met.name if hasattr(met, ‘name’) else camel2snake(met.class.name)) for met in self.metrics]
–> 195 self(‘train_begin’, metrics_names=names)
196
197 def on_epoch_begin(self)->None:

~/jupyter/repo-fastai-v1/fastai/callback.py in call(self, cb_name, call_mets, **kwargs)
186 “Call through to all of the CallbakHandler functions.”
187 if call_mets: [getattr(met, f’on_{cb_name}’)(**self.state_dict, **kwargs) for met in self.metrics]
–> 188 return [getattr(cb, f’on_{cb_name}’)(**self.state_dict, **kwargs) for cb in self.callbacks]
189
190 def on_train_begin(self, epochs:int, pbar:PBar, metrics:MetricFuncList)->None:

~/jupyter/repo-fastai-v1/fastai/callback.py in (.0)
186 “Call through to all of the CallbakHandler functions.”
187 if call_mets: [getattr(met, f’on_{cb_name}’)(**self.state_dict, **kwargs) for met in self.metrics]
–> 188 return [getattr(cb, f’on_{cb_name}’)(**self.state_dict, **kwargs) for cb in self.callbacks]
189
190 def on_train_begin(self, epochs:int, pbar:PBar, metrics:MetricFuncList)->None:

~/jupyter/repo-fastai-v1/fastai/basic_train.py in on_train_begin(self, pbar, metrics_names, **kwargs)
329 self.names += metrics_names
330 if hasattr(self, ‘_added_met_names’): self.names += self._added_met_names
–> 331 self.pbar.write(self.names, table=True)
332 self.losses,self.val_losses,self.lrs,self.moms,self.metrics,self.nb_batches = [],[],[],[],[],[]
333

~/jupyter/fastai-env/lib/python3.6/site-packages/fastprogress/fastprogress.py in write(self, line, table)
223 if not table: self.text += line + “


224 else:
–> 225 self.raw_text += line + “\n”
226 self.text = text2html_table(self.raw_text)
227

TypeError: can only concatenate list (not “str”) to list


#2

You don’t have the last version of fastprogress, you should upgrade it.


#3

I’m having the same problem but conda seems to think I have the latest version of fastprogress (0.1.13). What’s the best way to force an update to 0.1.18?

Thanks for the help.

EDIT: version 0.1.18 is on PyPI so I was able to fix this by pip installing the latest fast progress while in my conda env.


(Michal Wawrzyniuk) #4
conda install -c fastai fastprogress