SOLVED - pathlib.py was not installed correctly. whew!
Hey does anyone have a translate notebook running? My os does not seem to work with PosixPath even though I’m running python 3.6.4 and I’d like to know if anyone else is hitting similar problems.
I have consistent errors using PosixPath (see question in Beginner topic). The error is
TypeError: expected str, bytes or os.PathLike object, not PosixPath
So I have been converting all paths to strings using str() to open files, which is kind of a gross workaround, but it usually works.
But I can’t run a command like
learn = RNN_Learner(md, SingleModel(to_gpu(rnn)), opt_fn=opt_fn)
because the PosixPath problem comes up from code inside text.py.
I just want to make sure it’s just me having this problem (so probably a configuration error) before I go further in debugging wtf is up!
Thanks!
ps here’s my error trace:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-112-d0041fa690c8> in <module>()
2 # triggered by something inside fastai.core.SingleModel.
3
----> 4 learn = RNN_Learner(md, SingleModel(to_gpu(rnn)), opt_fn=opt_fn)
~/_ker-notebooks/dl2/fastai/text.py in __init__(self, data, models, **kwargs)
180 class RNN_Learner(Learner):
181 def __init__(self, data, models, **kwargs):
--> 182 super().__init__(data, models, **kwargs)
183 self.crit = F.cross_entropy
184
~/_ker-notebooks/dl2/fastai/learner.py in __init__(self, data, models, opt_fn, tmp_name, models_name, metrics, clip)
32 self.clip = None
33 self.opt_fn = opt_fn or SGD_Momentum(0.9)
---> 34 self.tmp_path = os.path.join(self.data.path, tmp_name)
35 self.models_path = os.path.join(self.data.path, models_name)
36 os.makedirs(self.tmp_path, exist_ok=True)
~/src/anaconda3/envs/fastai/lib/python3.6/posixpath.py in join(a, *p)
76 will be discarded. An empty last part will result in a path that
77 ends with a separator."""
---> 78 a = os.fspath(a)
79 sep = _get_sep(a)
80 path = a
TypeError: expected str, bytes or os.PathLike object, not PosixPath