Invalid syntax when trying to import utils and vgg16 in lesson 1

Hi there, I’ve searched a while for this exact error, but can’t find anything like it.

I ssh into my p2 instance fine, but on importing the utils and vgg16 python files I get the following error:

sorry, the error message wasn’t copied properly. it looks like this

FIle “vgg16.py”, line 7
!DOCTYPE html
^
Syntax Error

It seems to be in the actual syntax.

in the terminal in the folder where nbs are I write the following to get both the files:

wget https://github.com/fastai/courses/blob/master/deeplearning1/nbs/utils.py
wget https://github.com/fastai/courses/blob/master/deeplearning1/nbs/vgg16.py

Then I open up Jupyter Notebooks and go into Lesson1ipynb and all works fine. But when i get to importing the utils and vgg16, I get the same error above.

Any help much appreciated!!

1 Like

I figured it out. The wget extraction was incorrect for some reason. I went into each of the files on the github page, and copied all the code. I then went back into my terminal and made the file using nano - so i typed ‘nano utils.py’, and then pasted the script in there. I did this for vgg16 too. Once this was completed, I went back to the lesson1.ipynb and the imports ran fine

1 Like