-1
from fastai.conv_learner import *
from fastai.dataset import *

import pandas as pd
import numpy as np
import os
from PIL import Image
from sklearn.model_selection import train_test_split

I got following error during import

cuda 10.1
tensorflow = 2.0.0
Traceback (most recent call last):

   File
 "/home/jake/venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py",
 line 3326, in run_code
     exec(code_obj, self.user_global_ns, self.user_ns)

   File "<ipython-input-6-7dcee084b5a9>", line 1, in <module>
     from fastai.conv_learner import *

   File
 "/home/jake/venv/lib/python3.7/site-packages/fastai/conv_learner.py",
 line 1, in <module>
     from .core import *

   File "/home/jake/venv/lib/python3.7/site-packages/fastai/core.py",
 line 19
     def V_(x):  return to_gpu(x, async=True) if isinstance(x, Variable) else Variable(to_gpu(x, async=True))
                                      ^ SyntaxError: invalid syntax
talonmies
  • 70,661
  • 34
  • 192
  • 269
  • 2
    The library you are using appears to be trying to use `async` as a parameter name. This is an error because `async` is a keyword. The library was probably written for an earlier version of Python. Perhaps there are updated versions of these libraries that you can get. – khelwood Mar 02 '20 at 08:26
  • 1
    Does this answer your question? [Receiving .async error when trying to import the firebase package](https://stackoverflow.com/questions/52133031/receiving-async-error-when-trying-to-import-the-firebase-package) – MisterMiyagi Mar 02 '20 at 08:30

1 Answers1

1

You appear to be using an out of date version of fastai. In current versions of Python, async is a keyword, so trying to use async as a variable or a function argument is a syntax error. The version you are using must have been written for a much older version of Python.

I just had a look at fastai, and the current version does not have this problem. So you need to update to a more recent version of the library that is compatible with the Python version you are using.

khelwood
  • 55,782
  • 14
  • 81
  • 108