$ python3 --version
Python 3.6.1
$ python3 -m virtualenv venv
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.6'
New python executable in .../venv/bin/python3
Also creating executable in .../venv/bin/python
Installing setuptools, pip, wheel...done.
$ source venv/bin/activate
$ pip install tensorflow
Collecting tensorflow
Using cached tensorflow-1.2.0-cp36-cp36m-macosx_10_11_x86_64.whl
....
$ python
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.examples.tutorials.mnist import input_data
>>> mnist = input_data.read_data_sets("/tmp/data/")
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 808, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../venv/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py", line 235, in read_data_sets
SOURCE_URL + TRAIN_IMAGES)
File ".../venv/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 208, in maybe_download
temp_file_name, _ = urlretrieve_with_retry(source_url)
File ".../venv/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 165, in wrapped_fn
return fn(*args, **kwargs)
File ".../venv/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 190, in urlretrieve_with_retry
return urllib.request.urlretrieve(url, filename)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 248, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>
์ด๊ฒ์ TensorFlow 1.1์์ ์ฌํ๋์ง ์์ต๋๋ค.
python2(py์ ๊ธฐ๋ณธ ์์คํ ์ค์น)๋ก ์๋ํ ์ ์์ต๋๊น? ๋ํ brew ๋๋ macports๋ฅผ ์ฌ์ฉํ์ฌ ์ด๋ป๊ฒ ์ค์นํ์ต๋๊น(ํ ์คํธ์ brew๋ฅผ ์ฌ์ฉํ์ฌ ์๋ํ ๊ฐ๋ฅ์ฑ์ด ๋ ๋์).
Python ์น ์ฌ์ดํธ์์ dmg ์ค์น ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ์ฌ Python 3.6์ ์ค์นํ์ต๋๋ค(brew ๋๋ macport๋ฅผ ํตํ์ง ์์).
Python 2.7.10์์ ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋๋ Python 2.x์์ urlretrieve๊ฐ ์๋ฒ ์ธ์ฆ์์ ์ ํจ์ฑ์ ๊ฒ์ฌํ์ง ์๋๋ค๊ณ ์๊ฐํ์ง๋ง ๋ถ๋ช ํ 2.7.9๋ถํฐ ์ํํฉ๋๋ค. https://docs.python.org/2/library/urllib.html
Linux์ python 3.4์์ ์๋ํฉ๋๋ค. brew๋ฅผ ์ฌ์ฉํ์ฌ python3.6์ ์ค์นํ๋ ค๊ณ ํฉ๋๋ค. ์ฌ์ฉ ์ค์ธ python3 ๋ฐฐํฌํ์ ๋ฐ์ดํฐ ๋ถ์กฑ ์ธ์ฆ์๊ฐ ์์ ์ ์์ต๋๋ค.
์ต๊ทผ์ ์ ์ปดํจํฐ๋ก ์ ํํ๋๋ฐ ์์ง ๋ถ๋ถ์ ์ผ๋ก๋ง ์ค์น๋์ด ์๊ธฐ ๋๋ฌธ์ผ ์๋ ์์ต๋๋ค. :)
๋์ค์ ์ฐธ์กฐํ ์ ์๋๋ก: Python dmg ์ค์น ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ๋ ค๋ฉด Python 3์ ReadMe๋ ์ฝ๊ณ /Applications/Python 3.6/Install Certificates.command
bash ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ์ฌ ์ต์ ์ธ์ฆ์๋ฅผ ์ค์นํด์ผ ํฉ๋๋ค.
๋น ๋ฅธ ์๋ต์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค, @aselle!
๋ณต์ฌํ์ฌ ํฐ๋ฏธ๋์ ๋ถ์ฌ๋ฃ์ผ๋ ค๋ฉด ๋ค์์ ์ํํ์ญ์์ค.
/Applications/Python\ 3.6/Install\ Certificates.command
MacOSX 10.11.6์์ ์ ํํ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
๋จผ์ Python 3.n์ ๋ํ virtualenv
์ค์ ์ ๋ํ ๋จ๊ณ๋ฅผ ์ ํํ ๋ฐ๋์ต๋๋ค. https://www.tensorflow.org/install/install_mac
๊ทธ๋ฐ ๋ค์ ์ด ํํ ๋ฆฌ์ผ https://www.tensorflow.org/get_started/mnist/beginners ์ ์ฒ์ 2๋จ๊ณ๋ฅผ ๋ฐ๋ฅด๋ฉด ๋ค์์ด ํ์๋ฉ๋๋ค. ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํ ์ ์ ์ฌํญ(์: ๋ค๋ฅธ ๊ณณ์์ ๋ค์ด๋ก๋ํ ์ ์์ต๋๊น?)์ ํฌ๊ฒ ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.
(tensorflow) ~/tensorflow $ python
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.examples.tutorials.mnist import input_data
>>> mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 808, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/aaron/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py", line 235, in read_data_sets
SOURCE_URL + TRAIN_IMAGES)
File "/Users/aaron/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 208, in maybe_download
temp_file_name, _ = urlretrieve_with_retry(source_url)
File "/Users/aaron/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 165, in wrapped_fn
return fn(*args, **kwargs)
File "/Users/aaron/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 190, in urlretrieve_with_retry
return urllib.request.urlretrieve(url, filename)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 248, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)>
@brightbytes-dude ์ฌ๊ธฐ์ ๋์ด๋ ๋ช ๋ น์ ์คํํ์ จ์ต๋๊น: https://github.com/tensorflow/tensorflow/issues/10779#issuecomment -309134512
/Applications/Python\ 3.6/Install\ Certificates.command
๊ทธ๊ฒ์ ํธ๋ฆญ์ ํ๋ค, ๊ฐ์ฌํฉ๋๋ค!! (๋๋ ์ด๋ฆฌ์๊ฒ๋ ์ด๊ฒ์ด dmg
์ค์น์๋ง ๊ด๋ จ์ด ์๋ค๊ณ ๊ฐ์ ํ์ต๋๋ค.)
https๋ฅผ ์ฌ์ฉํ์ง ์๋๋ก contrib/learn/python/learn/datasets/mnist.py์ MNIST ๋ค์ด๋ก๋ URL์ ๋ณ๊ฒฝํด ์ฃผ์๊ฒ ์ต๋๊น? ์ด ๋ฌธ์ ๋ฅผ ๊ฒช๊ณ ์๋ ์ฌ๋๋ค์๊ฒ ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๋ธ๋ผ์ฐ์ ์์ ์๋ํ๊ณ http ๋ค์ด๋ก๋ ๋งํฌ๊ฐ ์๋ํฉ๋๋ค.
๋ณ๊ฒฝํ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
์ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
์๋
ํ์ญ๋๊น,
์ ๋ python๊ณผ tensorflow๋ฅผ ์ฒ์ ์ฌ์ฉํฉ๋๋ค. MNIST ์์ ๋ฅผ ์๋ํ๊ณ paulcwatts(์)์ ๊ฑฐ์ ๋์ผํ ์ค๋ฅ ๋ฉ์์ง ์์
tensorflow.examples.tutorials.mnist์์ import input_data ๊ฐ์ ธ์ค๊ธฐ
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
์ญ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง):
do_open์ ํ์ผ "C:UsersAndreasDocumentsPythonliburllibrequest.py", 1318ํ
encode_chunked=req.has_header('์ ์ก ์ธ์ฝ๋ฉ'))
ํ์ผ "C:UsersAndreasDocumentsPythonlibhttpclient.py", 1239ํ, ์์ฒญ
self._send_request(๋ฉ์๋, URL, ๋ณธ๋ฌธ, ํค๋, encode_chunked)
ํ์ผ "C:UsersAndreasDocumentsPythonlibhttpclient.py", 1285ํ, _send_request
self.endheaders(๋ณธ๋ฌธ, encode_chunked=encode_chunked)
ํ์ผ "C:UsersAndreasDocumentsPythonlibhttpclient.py", 1234ํ, ์๋ํค๋
self._send_output(message_body, encode_chunked=encode_chunked)
ํ์ผ "C:UsersAndreasDocumentsPythonlibhttpclient.py", 1026ํ, _send_output
self.send(๋ฉ์์ง)
ํ์ผ "C:UsersAndreasDocumentsPythonlibhttpclient.py", 964ํ, ์ ์ก ์ค
self.connect()
ํ์ผ "C:UsersAndreasDocumentsPythonlibhttpclient.py", ๋ผ์ธ 1400, ์ฐ๊ฒฐ
server_hostname=server_hostname)
wrap_socket์ ํ์ผ "C:UsersAndreasDocumentsPythonlibssl.py", 401ํ
_context=์์ , _session=์ธ์ )
ํ์ผ "C:UsersAndreasDocumentsPythonlibssl.py", 808ํ, __init__
self.do_handshake()
do_handshake์ ํ์ผ "C:UsersAndreasDocumentsPythonlibssl.py", 1061ํ
self._sslobj.do_handshake()
do_handshake์ ํ์ผ "C:UsersAndreasDocumentsPythonlibssl.py", 683ํ
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] ์ธ์ฆ์ ํ์ธ ์คํจ(_ssl.c:748)
์์ ์์ธ๋ฅผ ์ฒ๋ฆฌํ๋ ๋์ ๋ค๋ฅธ ์์ธ๊ฐ ๋ฐ์ํ์ต๋๋ค.
์ญ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง): ์ฃผ์ ์ฐจ์ด์ ์ ์ ๊ฐ WINDOWS 10์ ์ฌ์ฉ ์ค์ด๊ณ ์ธ์ฆ์ ๋ช
๋ น์ ์ฐพ์ ์ ์๋ค๋ ๊ฒ์
๋๋ค.
ํ์ผ "
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
ํ์ผ "C:UsersAndreasDocumentsPythonlibsite-packagestensorflowcontribblearnpythonlearndatasetsmnist.py", 240ํ, read_data_sets
source_url + TRAIN_IMAGES)
ํ์ผ "C:UsersAndreasDocumentsPythonlibsite-packagestensorflowcontribblearnpythonlearndatasetsbase.py", 208ํ, may_download
temp_file_name, _ = urlretrieve_with_retry(source_url)
"C:UsersAndreasDocumentsPythonlibsite-packagestensorflowcontribblearnpythonlearndatasetsbase.py" ํ์ผ, 165ํ, wrap_fn
๋ฐํ fn( ์ธ์, * kwargs)
ํ์ผ "C:UsersAndreasDocumentsPythonlibsite-packagestensorflowcontribblearnpythonlearndatasetsbase.py", 190ํ, urlretrieve_with_retry
๋ฐํ urllib.request.urlretrieve(url, ํ์ผ ์ด๋ฆ)
ํ์ผ "C:UsersAndreasDocumentsPythonliburllibrequest.py", 248ํ, urlretrieve
fp๋ก contextlib.closing(urlopen(url, data)) ์ฌ์ฉ:
ํ์ผ "C:UsersAndreasDocumentsPythonliburllibrequest.py", 223ํ, urlopen
opener.open(URL, ๋ฐ์ดํฐ, ์๊ฐ ์ด๊ณผ) ๋ฐํ
ํ์ผ "C:UsersAndreasDocumentsPythonliburllibrequest.py", 526ํ, ์ด๋ ค ์์
์๋ต = self._open(req, ๋ฐ์ดํฐ)
ํ์ผ "C:UsersAndreasDocumentsPythonliburllibrequest.py", 544ํ, _open
'_open', ํ์)
ํ์ผ "C:UsersAndreasDocumentsPythonliburllibrequest.py", 504ํ, _call_chain
๊ฒฐ๊ณผ = func(*์ธ์)
https_open์ ํ์ผ "C:UsersAndreasDocumentsPythonliburllibrequest.py", ๋ผ์ธ 1361
context=self._context, check_hostname=self._check_hostname)
do_open์ ํ์ผ "C:UsersAndreasDocumentsPythonliburllibrequest.py", ๋ผ์ธ 1320
URLError(err) ๋ฐ์
urllib.error.URL์ค๋ฅ:
"๋ฉ์ฒญํ ์ง๋ฌธ"์ ํด์ ์ฃ์กํ์ง๋ง ๊ทธ ์ค๋ฅ๋ "์ฌ๋ผ์ง์ง" ์์ต๋๋ค.
๋๋ ssl๊ณผ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์ผ๋ฉฐ์ด ์ค์ ๊ทธ๊ฒ์ ์์ ํฉ๋๋ค.
/Applications/Python 3.6/Certificate ์ค์น ๋ช
๋ น.
๊ฐ์ฌํฉ๋๋ค @EthanAI @aselle @paulcwatts
์ด ํ์ด์ง์ ๊ฑธ๋ ค ๋์ด์ง ์ฌ๋์ด ์์ง๋ง Ubuntu์์ Tensorflow Hub๋ฅผ ํ์ฉํ๋ ๋ต๋ณ์ ์ฐพ๊ณ ์๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด ์๋ํ๋๋ก ๋ง๋ค์์ต๋๋ค.
# Directory where user certs can be stored
cd /usr/local/share/ca-certificates
# Below may require elevated permissions, such as sudo su
pip3 install --upgrade certifi # Installs a certificate file
# Move the installed cert to the place Ubuntu expects it
cp /home/ubuntu/.local/lib/python3.5/site-packages/certifi/cacert.pem .
# Convert it into the format Ubuntu expects
openssl x509 -in cacert.pem -inform pem -outform der -out cacert.crt
# Actually load the new cert into the OS
update-ca-certificates
์ด ์ธ์๋ ํ์ฌ ํ๋ก์ ๊ตฌ์ฑ, Jupyter ๋ ธํธ๋ถ ์ปค๋ ๋ค์ ์์, ๋ ธํธ๋ถ์ด ์๋ ํฐ๋ฏธ๋์ ์คํฌ๋ฆฝํธ์์ TF Hub ์คํ์ ์ผ๋ถ ๋ง๋ฒ ๊ฐ์ ์กฐํฉ์ผ๋ก ์ธํด TF Hub๊ฐ ํฐ๋ฏธ๋๊ณผ ๋ ธํธ๋ถ ๋ชจ๋์์ ์๋ํ๊ฒ ๋์์ต๋๋ค. .
ํด๋น ๋ช
๋ น์ ์คํํ๋ ๊ฒ๋ ์คํจํ์ต๋๋ค.
./์ธ์ฆ์ ์ค์น ๋ช
๋ น
-- pip install --upgrade ์ธ์ฆ์
์ธ์ฆ์ ์์ง
์บ์ ํญ๋ชฉ ์ง๋ ฌํ ํด์ ์คํจ, ํญ๋ชฉ ๋ฌด์
URL https://pypi.python.org/simple/certifi/๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค: SSL ์ธ์ฆ์๋ฅผ ํ์ธํ๋ ๋ฐ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค: [SSL: CERTIFICATE_VERIFY_FAILED] ์ธ์ฆ์ ํ์ธ ์คํจ(_ssl.c:777) - ๊ฑด๋๋ฐ๊ธฐ
์๊ตฌ ์ฌํญ ์ธ์ฆ์๋ฅผ ์ถฉ์กฑํ๋ ๋ฒ์ ์ ์ฐพ์ ์ ์์ต๋๋ค(๋ฒ์ ์์: ).
์ธ์ฆ์์ ๋ํด ์ผ์นํ๋ ๋ถํฌ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.
์ญ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง):
ํ์ผ "
ํ์ผ "
check_call์์ ํ์ผ "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", 291ํ
CalledProcessError(retcode, cmd) ๋ฐ์
subprocess.CalledProcessError: ๋ช
๋ น '['/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6', '-E', '-s', '-m', 'pip', '์ค์น' , '--upgrade', 'certifi']'๊ฐ 0์ด ์๋ ์ข
๋ฃ ์ํ 1์ ๋ฐํํ์ต๋๋ค.
MacOS์์ /Applications/Python\ 3.6/Install\ Certificates.command
๋ช
๋ น์ด ์๋ํฉ๋๋ค.
/Applications/Python\ 3.6/Install\ Certificates.command
๋ MacOSX High Sierra์์ ๋ง์ ์ ๋ถ๋ ธ์ต๋๋ค. ๊ณ ๋ง์
๊ฐ์ ํ๊ฒฝ์ ์ฌ์ฉํ๋ ์ฌ๋๋ค์ ์ํ ์๋ฃจ์ ์ ๋ฌด์์ ๋๊น?
์ ๋ฐ์ดํธ: ์์์ ์ง์ ํ ๊ฒ๊ณผ ๋์ผํ ์์คํ ๋ช ๋ น์ ์คํํ๋ ๊ฒ์ฒ๋ผ ๋ณด์ ๋๋ค. ๐ ํ์ฑ ํ๊ฒฝ์์๋ ํธ๋ฆญ์ ์ํํฉ๋๋ค. ์์ ๋๋ง ํ!
๋ณต์ฌํ์ฌ ํฐ๋ฏธ๋์ ๋ถ์ฌ๋ฃ์ผ๋ ค๋ฉด ๋ค์์ ์ํํ์ญ์์ค.
/Applications/Python\ 3.6/Install\ Certificates.command
๊ณ ๋ง์!
์ต๊ทผ์ ์ ์ปดํจํฐ๋ก ์ ํํ๋๋ฐ ์์ง ๋ถ๋ถ์ ์ผ๋ก๋ง ์ค์น๋์ด ์๊ธฐ ๋๋ฌธ์ผ ์๋ ์์ต๋๋ค. :)
๋์ค์ ์ฐธ์กฐํ ์ ์๋๋ก: Python dmg ์ค์น ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ๋ ค๋ฉด Python 3์ ReadMe๋ ์ฝ๊ณ
/Applications/Python 3.6/Install Certificates.command
bash ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ์ฌ ์ต์ ์ธ์ฆ์๋ฅผ ์ค์นํด์ผ ํฉ๋๋ค.๋น ๋ฅธ ์๋ต์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค, @aselle!
๊ฐ์ฌ ํด์! ํจ๊ณผ๊ฐ ์์๋ค! :NS
๊ฐ์ฌ ํด์
https๋ฅผ ์ฌ์ฉํ์ง ์๋๋ก contrib/learn/python/learn/datasets/mnist.py์ MNIST ๋ค์ด๋ก๋ URL์ ๋ณ๊ฒฝํด ์ฃผ์๊ฒ ์ต๋๊น? ์ด ๋ฌธ์ ๋ฅผ ๊ฒช๊ณ ์๋ ์ฌ๋๋ค์๊ฒ ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๋ธ๋ผ์ฐ์ ์์ ์๋ํ๊ณ http ๋ค์ด๋ก๋ ๋งํฌ๊ฐ ์๋ํฉ๋๋ค.
๋ณ๊ฒฝํ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
์ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
๋ URL์ด ๋์ผํ ๊ฒ์ ์ ์ ์์ต๋๋ค.
https๋ฅผ ์ฌ์ฉํ์ง ์๋๋ก contrib/learn/python/learn/datasets/mnist.py์ MNIST ๋ค์ด๋ก๋ URL์ ๋ณ๊ฒฝํด ์ฃผ์๊ฒ ์ต๋๊น? ์ด ๋ฌธ์ ๋ฅผ ๊ฒช๊ณ ์๋ ์ฌ๋๋ค์๊ฒ ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๋ธ๋ผ์ฐ์ ์์ ์๋ํ๊ณ http ๋ค์ด๋ก๋ ๋งํฌ๊ฐ ์๋ํฉ๋๋ค.
๋ณ๊ฒฝํ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
์ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
๊ทธ๊ฒ์ ๋๋ฅผ ์ํด ์ผํ์ต๋๋ค.
ํฐ๋ฏธ๋์์ ์
๋ ฅ๋ง ํ๋ฉด ๋ฉ๋๋ค.
open "/Applications/Python 3.6/Install Certificates.command"
https๋ฅผ ์ฌ์ฉํ์ง ์๋๋ก contrib/learn/python/learn/datasets/mnist.py์ MNIST ๋ค์ด๋ก๋ URL์ ๋ณ๊ฒฝํด ์ฃผ์๊ฒ ์ต๋๊น? ์ด ๋ฌธ์ ๋ฅผ ๊ฒช๊ณ ์๋ ์ฌ๋๋ค์๊ฒ ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๋ธ๋ผ์ฐ์ ์์ ์๋ํ๊ณ http ๋ค์ด๋ก๋ ๋งํฌ๊ฐ ์๋ํฉ๋๋ค.
๋ณ๊ฒฝํ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
์ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '๋ URL์ด ๋์ผํ ๊ฒ์ ์ ์ ์์ต๋๋ค.
' https://... '๋ฅผ ' http://... '๋ก ๋ณ๊ฒฝ
/Applications/Python 3.7/Certificate ์ค์น ๋ช
๋ น.
๋๋ฅผ ์ํด ์ผํด
Manjaro Linux์์ ์ด๋ป๊ฒ ํฉ๋๊น? Python3.7 ํ ์ํ๋ก๊ฐ ์์ต๋๋ค.
๋ณต์ฌํ์ฌ ํฐ๋ฏธ๋์ ๋ถ์ฌ๋ฃ์ผ๋ ค๋ฉด ๋ค์์ ์ํํ์ญ์์ค.
/Applications/Python\ 3.6/Install\ Certificates.command
๊ณ ๋ง์์! ๊ทธ๊ฒ์ ๋๋ฅผ ์ํด ์๋ํฉ๋๋ค!
jupyter ๋
ธํธ๋ถ์์ ์ฝ๋๋ฅผ ์คํํฉ๋๋ค.
!/Applications/Python\ 3.6/Install\ Certificates.command
.local/python3.X/lib/python3.6/site-packages/keras/utils/data_utils.py๋ก ์ด๋ํฉ๋๋ค.
```๊ฐ์ ธ์ค๊ธฐ ์์ฒญ
์์ฒญ.ํจํค์ง.urllib3.disable_warnings()
SSL ๊ฐ์ ธ์ค๊ธฐ
๋
ธ๋ ฅํ๋ค:
_create_unverified_https_context = SSL._create_unverified_context
AttributeError ์ ์ธ:
# ๊ธฐ๋ณธ์ ์ผ๋ก HTTPS ์ธ์ฆ์๋ฅผ ํ์ธํ์ง ์๋ ๋ ๊ฑฐ์ Python
ํต๊ณผํ๋ค
๋ ๋ค๋ฅธ:
# HTTPS ๊ฒ์ฆ์ ์ง์ํ์ง ์๋ ๋์ ํ๊ฒฝ ์ฒ๋ฆฌ
SSL._create_default_https_context = _create_unverified_https_context
```
์ด์ python์ ์ ์ธ์คํด์ค๋ฅผ ์๋ํ๊ณ .. ์ ์๋ํฉ๋๋ค :smile_cat:
์ต๊ทผ์ ์ ์ปดํจํฐ๋ก ์ ํํ๋๋ฐ ์์ง ๋ถ๋ถ์ ์ผ๋ก๋ง ์ค์น๋์ด ์๊ธฐ ๋๋ฌธ์ผ ์๋ ์์ต๋๋ค. :)
๋์ค์ ์ฐธ์กฐํ ์ ์๋๋ก: Python dmg ์ค์น ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ๋ ค๋ฉด Python 3์ ReadMe๋ ์ฝ๊ณ
/Applications/Python 3.6/Install Certificates.command
bash ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ์ฌ ์ต์ ์ธ์ฆ์๋ฅผ ์ค์นํด์ผ ํฉ๋๋ค.๋น ๋ฅธ ์๋ต์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค, @aselle!
์ด ๋๊ธ๋ก ์ ๋ชฉ์จ์ ๊ตฌํ์ต๋๋ค! <3
https๋ฅผ ์ฌ์ฉํ์ง ์๋๋ก contrib/learn/python/learn/datasets/mnist.py์ MNIST ๋ค์ด๋ก๋ URL์ ๋ณ๊ฒฝํด ์ฃผ์๊ฒ ์ต๋๊น? ์ด ๋ฌธ์ ๋ฅผ ๊ฒช๊ณ ์๋ ์ฌ๋๋ค์๊ฒ ๋์์ด ๋ ๊ฒ์ ๋๋ค. ๋ธ๋ผ์ฐ์ ์์ ์๋ํ๊ณ http ๋ค์ด๋ก๋ ๋งํฌ๊ฐ ์๋ํฉ๋๋ค.
๋ณ๊ฒฝํ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
์ ์ค:
SOURCE_URL = ' https://storage.googleapis.com/cvdf-datasets/mnist/ '
์ด๊ฒ์ ์ฐ๋ถํฌ์์ ๋๋ฅผ ์ํด ์๋ํฉ๋๋ค.
~/miniconda/envs/py36/lib/python3.6/site-packages/tensorflow_core/python/keras/datasets/mnist.py
์๋ก์ด ๋ผ์ธ
origin_folder = 'http://storage.googleapis.com/tensorflow/tf-keras-datasets/'
๋๋ฅผ ์ํด ์ผํ ๊ฒ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
๊ทธ๊ฒ ๋ค์ผ. keras ๋ค์ด๋ก๋ ์ ํธ๋ฆฌํฐ๋ ๋คํธ์ํฌ๋ฅผ ํตํด ์ด๋ํ๊ธฐ ์ ์ ํด๋น ํด๋์์ ์บ์๋ ๋ฐ์ดํฐ๋ฅผ ์ฐพ์ต๋๋ค.
(ํ์ด์ฌ 3.7.3, ํ ์ํ๋ก 2.1.0)
/Applications/Python 3.6/Install Certificates.command ์ด๊ฒ์ ๊ฐ์ ํ๊ฒฝ์์๋ ์๋ํฉ๋๊น?
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ต๊ทผ์ ์ ์ปดํจํฐ๋ก ์ ํํ๋๋ฐ ์์ง ๋ถ๋ถ์ ์ผ๋ก๋ง ์ค์น๋์ด ์๊ธฐ ๋๋ฌธ์ผ ์๋ ์์ต๋๋ค. :)
๋์ค์ ์ฐธ์กฐํ ์ ์๋๋ก: Python dmg ์ค์น ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ๋ ค๋ฉด Python 3์ ReadMe๋ ์ฝ๊ณ
/Applications/Python 3.6/Install Certificates.command
bash ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ์ฌ ์ต์ ์ธ์ฆ์๋ฅผ ์ค์นํด์ผ ํฉ๋๋ค.๋น ๋ฅธ ์๋ต์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค, @aselle!