I am trying to setup an ML model using fastai and have to do the following imports:
import fastai.models
import fastai.nlp
import fastai.dataset
However, it gives me the following error by the fastai
imports.
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fastai.nlp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/fastai/nlp.py", line 172
if os.path.isdir(path): paths=glob(f'{path}/*.*')
^
SyntaxError: invalid syntax
Apparently, the character f
in glob(f'{path}/*.*')
is causing the error. I fixed the error by removing f
, but it seems that there are lots of these errors in the fastai
library.
My current thought is that I am using an incorrect python version. Could anyone give me some pointer?