[solved] Local Linux setup: ValueError: padding_mode needs to be 'zeros' or 'border', but got reflection

I am using a Linux machine here where I manually installed the packages by looking at the bash commands from http://course-v3.fast.ai/start_aws.html#step-6-access-fastai-materials (before that I installed miniconda from https://conda.io/miniconda.html )

I am getting ValueError: padding_mode needs to be 'zeros' or 'border', but got reflection and had to manually patch fastai/vision/image.py and replace reflection with zeros.

Once that is done, I am able to train locally, albeit very slowly as I’m also using pytorch-cpu.

The above error was also independently discovered by @agoldina (https://forums.fast.ai/t/chicago-usa-area/27424/19?u=emi ).

This seems to me to be a packaging problem? Are the conda packages stale?

I’m also confused as to why we are using pytorch-nightly when the baseline is supposed to be pytorch 1.0.

Nevermind, it seems to be a problem with the packages I installed.

pytorch-cpu is not the CPU backend for pytorch-nightly, it’s an older version of Pytorch actually.

I had to install pytorch-nightly-cpu

1 Like

For anybody following fastai-1.0.15 also removed ConvLearner you have to downgrade to 1.0.14 with conda install -c fastai fastai=1.0.14

No don’t do that - instead follow the instructions in the official update thread:

Usually 1.0 means a stable release. You should not introduce breaking changes in a dot release.

I ran into the exact same problem on AWS EC2 even though I had followed your instructions https://course.fast.ai/start_aws.html