fastai / fastbook

The fastai book, published as Jupyter Notebooks
Other
21.68k stars 8.38k forks source link

09_tabular.ipynb: NameError: name 'file_extract' is not defined #468

Closed erg closed 2 years ago

erg commented 3 years ago

When running notebook 9, there's no file_extract function.

NameError                                 Traceback (most recent call last)
/tmp/ipykernel_77010/3628020118.py in <module>
      2     path.mkdir(parents=true)
      3     api.competition_download_cli('bluebook-for-bulldozers', path=path)
----> 4     file_extract(path/'bluebook-for-bulldozers.zip')
      5 
      6 path.ls(file_type='text')

NameError: name 'file_extract' is not defined

You can fix it manually:

cd ~/.fastai/archive/bluebook
unzip bluebook-for-bulldozers.zip
RCristyan commented 3 years ago

Thank you very much!

For some weird reason, this exact command did not work on google colab because unzip could not find the file... But with this command, it worked just fine:

!unzip /root/.fastai/archive/bluebook/bluebook-for-bulldozers.zip -d /root/.fastai/archive/bluebook
jquintanilla4 commented 3 years ago

Thank you! x10000

I've spent the better part of an hour trying to fix this issue. After I rewrote the python to make the downloading part of the if statement work properly... For anyone using gradient paperspace and reads this in the near future. Run the cd and unzip commands in a jupyter terminal, not in the notebook.

mone27 commented 2 years ago

I had the same issues, and I have solved it by manually defining the file_extract function in the notebook. I have taken the function from https://github.com/fastai/fastai2/blob/f9231256e2a8372949123bda36e44cb0e1493aa2/fastai2/data/external.py#L215, which contains a working version of the function (and in my understanding what was valid at the time the book was written). For me in this way the whole notebook is working

miwojc commented 2 years ago

This can be closed @jph00 Fixed in 111e6c5b1c54d491f8579de3b8260b112a4e7101