Error when running tests locally

I am getting the following error when running tests (I execute pytest from the test directory under the root of the repo):

=========================================================== test session starts ============================================================
platform linux -- Python 3.7.0, pytest-3.9.2, py-1.7.0, pluggy-0.8.0
rootdir: /home/radek/workspace/fastai, inifile: setup.cfg
collected 59 items / 1 errors                                                                                                              

================================================================== ERRORS ==================================================================
_____________________________________________ ERROR collecting tests/ ______________________________________________ in <module>
    extras_require = [(re.split(r'[>=<]+',x))[0] for x in data['extras_require']['dev']]
E   KeyError: 'extras_require'
------------------------------------------------------------- Captured stdout -------------------------------------------------------------- is at '/home/radek/workspace/fastai'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================= 1 error in 2.38 seconds ==========================================================

If someone has seen the test before or would have a suggestion on what I should check that would be greatly appreciated

Is it still the case? It seems to go fine on GitHub.

For some reason the parsing of the file does not seem to work on my machine, it seems. Will look at this hopefully later today, if not early tomorrow, and will see what I can find :slight_smile:

Turns out pytest need to be executed from the root of the repo and not from within the tests folder.

In tests/ we identify where the absolute path of where and setup.cfg reside but I don’t think this

    def _change_cwd(target_dir):
        cd_to_work = True
            cwd = os.getcwd()
        except OSError:
            cwd = recipe_dir or work_dir
        # this is very important - or else if versioneer or otherwise is in the start folder,
        # things will pick up the wrong versioneer/whatever!
        sys.path.insert(0, target_dir)
        return cd_to_work, cwd

gets ever run.

Anyhow, if pytest is run from the root of the repo I do not get the error.

Ah yes, always run it from there.

Here’s the docs on that for future reference:

1 Like

I’m getting error

ValueError: padding_mode needs to be 'zeros' or 'border', but got reflection

when trying to work locally…

I think something is messed up with the versions I have installed with pip3…

Here they are:

fastai: 1.0.19
torch: 0.4.1
torchvision: 0.2.1

Any suggestion?

You should read the installation instructions more carefully. fastai needs pytorch v1 or more.

1 Like

Does anybody had the following issue when trying to run the instance?


That looks like an error with the service provider. It seems that you have a quota of 0 GPUs but are requesting 1 or more GPUs. You may need to request an exception to be allowed to use a GPU.

Google seems really funny

You cannot add GPUs to your Compute Engine instances.

Thanks Google!

Whomever this may help - slightly different error, but same ‘sympton’ (ERROR collecting tests)

some issue with matplotlib