Hello Palaash,
Below is the error details
TypeError Traceback (most recent call last)
in ()
1
----> 2 learn_c = text_classifier_learner(data_clas, AWD_LSTM, drop_mult=0.5,metrics=[accuracy,f1]).to_fp32()
3 learn_c.load_encoder(f’{lang}fine_tuned_enc’)
4 learn_c.freeze()
9 frames
/usr/local/lib/python3.6/dist-packages/fastai/text/learner.py in text_classifier_learner(data, arch, bptt, max_len, config, pretrained, drop_mult, lin_ftrs, ps, **learn_kwargs)
299 warn(“There are no pretrained weights for that architecture yet!”)
300 return learn
–> 301 model_path = untar_data(meta[‘url’], data=False)
302 fnames = [list(model_path.glob(f’*.{ext}’))[0] for ext in [‘pth’, ‘pkl’]]
303 learn = learn.load_pretrained(*fnames, strict=False)
/usr/local/lib/python3.6/dist-packages/fastai/datasets.py in untar_data(url, fname, dest, data, force_download, verbose)
224 def untar_data(url:str, fname:PathOrStr=None, dest:PathOrStr=None, data=True, force_download=False, verbose=False) -> Path:
225 “Download url
to fname
if dest
doesn’t exist, and un-tgz to folder dest
.”
–> 226 dest = url2path(url, data) if dest is None else Path(dest)/url2name(url)
227 fname = Path(ifnone(fname, _url2tgz(url, data)))
228 if force_download or (fname.exists() and url in _checks and _check_file(fname) != _checks[url]):
/usr/local/lib/python3.6/dist-packages/fastai/datasets.py in url2path(url, data, ext)
189 “Change url
to a path.”
190 name = url2name(url)
–> 191 return datapath4file(name, ext=ext, archive=False) if data else modelpath4file(name, ext=ext)
192
193 def _url2tgz(url, data=True, ext:str=’.tgz’):
/usr/local/lib/python3.6/dist-packages/fastai/datasets.py in modelpath4file(filename, ext)
198 local_path = URLs.LOCAL_PATH/‘models’/filename
199 if local_path.exists() or local_path.with_suffix(ext).exists(): return local_path
–> 200 else: return Config.model_path()/filename
201
202 def datapath4file(filename:str, ext:str=’.tgz’, archive=True):
/usr/local/lib/python3.6/dist-packages/fastai/datasets.py in model_path(cls)
162 def model_path(cls):
163 “Get the path to fastai pretrained models in the config file.”
–> 164 return cls.get_path(‘model_path’)
165
166 @classmethod
/usr/local/lib/python3.6/dist-packages/fastai/datasets.py in get_path(cls, path)
147 def get_path(cls, path):
148 “Get the path
in the config file.”
–> 149 return _expand_path(cls.get_key(path))
150
151 @classmethod
/usr/local/lib/python3.6/dist-packages/fastai/datasets.py in _expand_path(fpath)
182 yaml.dump(cls.DEFAULT_CONFIG, yaml_file, default_flow_style=False)
183
–> 184 def _expand_path(fpath): return Path(fpath).expanduser()
185 def url2name(url): return url.split(’/’)[-1]
186
/usr/lib/python3.6/pathlib.py in new(cls, *args, **kwargs)
999 if cls is Path:
1000 cls = WindowsPath if os.name == ‘nt’ else PosixPath
-> 1001 self = cls._from_parts(args, init=False)
1002 if not self._flavour.is_supported:
1003 raise NotImplementedError(“cannot instantiate %r on your system”
/usr/lib/python3.6/pathlib.py in _from_parts(cls, args, init)
654 # right flavour.
655 self = object.new(cls)
–> 656 drv, root, parts = self._parse_args(args)
657 self._drv = drv
658 self._root = root
/usr/lib/python3.6/pathlib.py in _parse_args(cls, args)
638 parts += a._parts
639 else:
–> 640 a = os.fspath(a)
641 if isinstance(a, str):
642 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not NoneType