Comments (16)
Hi Aishni,
I believe this bug is due to the fact that Python 3.6 on MacOSX has no certificates at all (see the release notes), so it cannot verify the SSL certificate from GitHub's servers when trying to download housing.tgz
. See the second answer to this StackOverflow question for details. The solution is to:
- read
/Applications/Python 3.6/ReadMe.rtf
- the ReadMe will have you run
/Applications/Python 3.6/Install Certificates.command
which installs the certificates.
Alternatively, you can work around the issue by downloading the file yourself and placing it in the housing
directory, then comment out the urlretrieve()
line in the code, and run it again.
Hope this helps,
Aurélien
from handson-ml.
For Mac OS X
- Update to Python 3.6.5 using the native app installer downloaded from the official Python language website https://www.python.org/downloads/
I've found that the installer is taking care of updating the links and symlinks for the new Python a lot better than homebrew.
-
Install a new certificate using "./Install Certificates.command" which is in the refreshed Python 3.6 directory
cd "/Applications/Python 3.6/"
sudo "./Install Certificates.command"
from handson-ml.
Hi Aishni,
Did my answer solve your problem? May I close this issue?
Cheers,
Aurélien
from handson-ml.
from handson-ml.
Perfect, thanks for your feedback. :)
from handson-ml.
Thanks the solution worked .
read /Applications/Python 3.6/ReadMe.rtf
the ReadMe will have you run /Applications/Python 3.6/Install Certificates.command which installs the certificates.
from handson-ml.
Hey
i'm using fedora as os
it's give me error below
i'm using pycharm with envs of anaconda
WARNING:tensorflow:From /home/sunil/PycharmProjects/test/testFile.py:7: read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
Extracting MNIST_data/train-images-idx3-ubyte.gz
WARNING:tensorflow:From /home/sunil/anaconda3/envs/condaEnvTest/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:260: maybe_download (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Please write your own downloading logic.
WARNING:tensorflow:From /home/sunil/anaconda3/envs/condaEnvTest/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:262: extract_images (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
Extracting MNIST_data/train-labels-idx1-ubyte.gz
WARNING:tensorflow:From /home/sunil/anaconda3/envs/condaEnvTest/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:267: extract_labels (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
WARNING:tensorflow:From /home/sunil/anaconda3/envs/condaEnvTest/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:110: dense_to_one_hot (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.one_hot on tensors.
Extracting MNIST_data/t10k-images-idx3-ubyte.gz
Extracting MNIST_data/t10k-labels-idx1-ubyte.gz
WARNING:tensorflow:From /home/sunil/anaconda3/envs/condaEnvTest/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:290: DataSet.__init__ (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
from handson-ml.
Hi @Sunil1997 ,
These are just warnings, not errors, you can ignore them for now. I will update the notebooks to use Keras' functionality for loading MNIST, because TensorFlow's functionality has been deprecated and is printing all these warnings. However, the code still works for now, so you can just ignore these warnings.
from handson-ml.
i am run the following on red hat Linux
In [12]: from keras.applications import VGG16
In [13]: from keras import backend as K
In [14]: model = VGG16(weights='imagenet', include_top=False)
and i found the following error
Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
~/anaconda3/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1317 h.request(req.get_method(), req.selector, req.data, headers,
-> 1318 encode_chunked=req.has_header('Transfer-encoding'))
1319 except OSError as err: # timeout error
~/anaconda3/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
1253 """Send a complete request to the server."""
-> 1254 self._send_request(method, url, body, headers, encode_chunked)
1255
~/anaconda3/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1299 body = _encode(body, 'body')
-> 1300 self.endheaders(body, encode_chunked=encode_chunked)
1301
~/anaconda3/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
1248 raise CannotSendHeader()
-> 1249 self._send_output(message_body, encode_chunked=encode_chunked)
1250
~/anaconda3/lib/python3.6/http/client.py in _send_output(self, message_body, encode_chunked)
1035 del self._buffer[:]
-> 1036 self.send(msg)
1037
~/anaconda3/lib/python3.6/http/client.py in send(self, data)
973 if self.auto_open:
--> 974 self.connect()
975 else:
from handson-ml.
Hi @jemberie ,
This code does not look like it comes from the book or from this repository. It looks like you're getting a timeout while downloading VGG16. Check your internet connection? Try from another computer? If nothing works, please ask on StackOverflow instead.
from handson-ml.
This fixes it too -- added the ssl context workaround
import os
import tarfile
import urllib
import ssl
DOWNLOAD_ROOT = "https://raw.githubusercontent.com/ageron/handson-ml2/master/"
HOUSING_PATH = os.path.join("datasets", "housing")
HOUSING_URL = DOWNLOAD_ROOT + "datasets/housing/housing.tgz"
def fetch_housing_data(housing_url=HOUSING_URL, housing_path=HOUSING_PATH):
os.makedirs(housing_path, exist_ok=True)
tgz_path = os.path.join(housing_path, "housing.tgz")
context = ssl._create_unverified_context()
response = urllib.request.urlopen(housing_url, context=context)
with open(tgz_path, 'wb') as f:
f.write(response.read())
housing_tgz = tarfile.open(tgz_path)
housing_tgz.extractall(path=housing_path)
housing_tgz.close()
from handson-ml.
--This answer is for MACOS--
Hi,
For python 3.9 and above, just go to Applications -> Python x.x -> there will be a .command file to install certificates, just click on that and you're done.
from handson-ml.
from handson-ml.
from handson-ml.
from handson-ml.
from handson-ml.
Related Issues (20)
- mnist dataset HOT 2
- Chapter#02 FileNotFoundError HOT 1
- Chapter 2 error during prediction HOT 2
- Ml
- Dropout at test time HOT 3
- How can I use my own dataset and fit it to your code
- Need help understanding crc hash used to explain test train split in Chapter 2 HOT 1
- ImportError: cannot import name 'fetch_mldata' from 'sklearn.datasets' (F:\Anaconda3\lib\site-packages\sklearn\datasets\__init__.py) HOT 1
- Chapter 3 : Exercise 1 - MNIST Classifier with 97% accuracy - Could not pickle the task to send it to the workers. HOT 3
- Broken image in readme HOT 1
- Chapter 5 SVM why should center before LinearSVC
- Chapter 3 (Page 82): Getting error during Fitting the SGD Classifier with Training data
- Chapter 2: Value differences in prediction
- Chapter 2: Looking for Correlations - ValueError: could not convert string to float: 'INLAND' HOT 1
- Use github.com/apssouza22/chatflow as a conversational layer. It would enable actual API requests to be carried out from natural language inputs.
- chapter 4: SGDRegressor(tol=-np.infty) is not accepted by the module HOT 1
- Hi
- Ch.2 Error using corr() HOT 1
- Problem downloading data HOT 1
- Why does saving the test set not work?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handson-ml.