Can't run notebook code as .py file

I’m sure there’s a simple answer to this, but I can’t figure it out. I have code that works perfectly in a Jupyter Notebook, but when I copy it into a .py file, place it in the same folder and run it, I get a Segmentation fault (core dumped) error. What am I missing?

Disregard this question: Updating the repo seems to have fixed the problem.

I’m having a similar problem, it persists after running

conda install -c pytorch pytorch-cpu torchvision
conda install -c fastai fastai

I get a segmentation fault when I try to import fastai in the interpreter or in a .py file, but it works OK in a notebook. Any ideas? Is there another way to update things that I’m not doing?

I’m using fastai/old which is installed and updated as described here. However, I’m not entirely sure that’s what fixed the problem. I may have had some incorrect path references in my import statements. The Segmentation fault occurred again later. That time I discovered that I was working from fastai/old, but my import statements were pointing to code in fastai v1.

1 Like