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

In Chapter16 Shakespearean dataset load problem #19

Closed
klyuhang9 opened this issue Dec 8, 2020 · 1 comment
Closed

In Chapter16 Shakespearean dataset load problem #19

klyuhang9 opened this issue Dec 8, 2020 · 1 comment

Comments

@klyuhang9
Copy link

klyuhang9 commented Dec 8, 2020

Hi, I bought your book, then I excitedly tried to complete the task of generating Shakespearean in the book, but I found that. When I ran this code:

shakespeare_url = "https://homl.info/shakespeare"
filepath = keras.utils.get_file("shakespeare.txt", shakespeare_url)

the program would report an error. The error alert is as follows:
File "C:\python\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 282, in get_file raise Exception(error_msg.format(origin, e.errno, e.reason)) Exception: URL fetch failure on https://homl.info/shakespeare: None -- [Errno 11004] getaddrinfo failed

I could not fine how to fix this. Hope your hope.

@ageron
Copy link
Owner

ageron commented Mar 20, 2021

Hi @klyuhang9 ,
Thanks for your question. I just tried this code, and it works fine for me.
Looking at the error message, the getaddrinfo failed message probably shows that there was a DNS error. The homl.info domain name was not resolved correctly. This may be due to a temporary DNS issue, so you could retry now. If the problem persists, it might be due to a firewall or VPN issue, or some other network issue.
You could also try replacing the URL with this:

shakespeare_url = "https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt"

If that still does not work, then try downloading the file manually (in your web browser) and save it to $HOME/.keras/datasets/shakespeare.txt where $HOME is the path to your home directory (e.g., /Users/your_user_name).

Hope this helps!

@ageron ageron closed this as completed Mar 20, 2021
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

2 participants