Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NameError: name 'DATA_URL' is not defined #685

Closed
calpa opened this issue Jan 6, 2020 · 5 comments
Closed

[BUG] NameError: name 'DATA_URL' is not defined #685

calpa opened this issue Jan 6, 2020 · 5 comments

Comments

@calpa
Copy link

calpa commented Jan 6, 2020

When I follow the example in Chapter 2.4 Calculus, the first block can not be executed.

%matplotlib inline

import d2l
from IPython import display
from mxnet import np, npx
npx.set_np()

def f(x):
    return 3 * x ** 2 - 4 * x

Which prompts the following error:

/usr/local/lib/python3.6/dist-packages/d2l/d2l.py in <module>()
    359 # Defined in file: ./chapter_multilayer-perceptrons/kaggle-house-price.md
    360 DATA_HUB['kaggle_house_train'] = (
--> 361     DATA_URL+'kaggle_house_pred_train.csv',
    362     '585e9cc93e70b39160e7921475f9bcd7d31219ce')
    363 

NameError: name 'DATA_URL' is not defined

https://github.com/d2l-ai/d2l-en/blob/master/d2l/d2l.py#L361

The DATA_URL is defined in chapter_multilayer-perceptrons/kaggle-house-price.md, but not in the d2l.py.

@astonzhang
Copy link
Member

Thanks. We are adding those back
bca6cfb

@ezzatmostafa96
Copy link

So what's the answer to such a problem?

@calpa
Copy link
Author

calpa commented Jan 7, 2020

@ezzatmostafa96 downgrade d2l to 0.11.0, i.e. pip install d2l==0.11.0 or wait the new patch.

@astonzhang
Copy link
Member

astonzhang commented Jan 11, 2020

To always get the most updated d2l lib (sometimes we may not promptly upload the patch to pypi), simply

git clone https://github.com/d2l-ai/d2l-en.git
cd d2l-en
python setup.py develop

Below lists the uploaded versions of d2l on pypi that you can pip install:
https://pypi.org/project/d2l/#history

For now, you may get the most updated version by

pip install d2l --upgrade

@astonzhang
Copy link
Member

@ezzatmostafa96 see my comment above. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants