Partage
  • Partager sur Facebook
  • Partager sur Twitter

Initiez-vous au Machine Learning

Import dataset

    9 octobre 2023 à 22:31:13

    Bonjour, besoin de votre aide svp 

    j'essaie d'importer le jeu de donnée 

    from sklearn.datasets import fetch_openml
    mnist = fetch_openml('mnist_784', version=1)

    j'obtiens ce message d'erreur,

    Warning (from warnings module):
    File "C:\Python\Lib\site-packages\sklearn\datasets\_openml.py", line 110
    warn(
    UserWarning: A network error occurred while downloading https://api.openml.org/api/v1/json/data/list/data_name/mnist_784/limit/2/data_version/1. Retrying...
    Traceback (most recent call last):
    File "C:\Python\Lib\urllib\request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
    File "C:\Python\Lib\http\client.py", line 1319, in request
    self._send_request(method, url, body, headers, encode_chunked)
    File "C:\Python\Lib\http\client.py", line 1365, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
    File "C:\Python\Lib\http\client.py", line 1314, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
    File "C:\Python\Lib\http\client.py", line 1074, in _send_output
    self.send(msg)
    File "C:\Python\Lib\http\client.py", line 1018, in send
    self.connect()
    File "C:\Python\Lib\http\client.py", line 1460, in connect
    self.sock = self._context.wrap_socket(self.sock,
    File "C:\Python\Lib\ssl.py", line 455, in wrap_socket
    return self.sslsocket_class._create(
    File "C:\Python\Lib\ssl.py", line 1046, in _create
    self.do_handshake()
    File "C:\Python\Lib\ssl.py", line 1317, in do_handshake
    self._sslobj.do_handshake()
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "<pyshell#1>", line 1, in <module>
    mnist = fetch_openml('mnist_784', version=1)
    File "C:\Python\Lib\site-packages\sklearn\utils\_param_validation.py", line 211, in wrapper
    return func(*args, **kwargs)
    File "C:\Python\Lib\site-packages\sklearn\datasets\_openml.py", line 980, in fetch_openml
    data_info = _get_data_info_by_name(
    File "C:\Python\Lib\site-packages\sklearn\datasets\_openml.py", line 322, in _get_data_info_by_name
    json_data = _get_json_content_from_openml_api(
    File "C:\Python\Lib\site-packages\sklearn\datasets\_openml.py", line 246, in _get_json_content_from_openml_api
    return _load_json()
    File "C:\Python\Lib\site-packages\sklearn\datasets\_openml.py", line 67, in wrapper
    return f(*args, **kw)
    File "C:\Python\Lib\site-packages\sklearn\datasets\_openml.py", line 241, in _load_json
    _open_openml_url(url, data_home, n_retries=n_retries, delay=delay)
    File "C:\Python\Lib\site-packages\sklearn\datasets\_openml.py", line 173, in _open_openml_url
    _retry_on_network_error(n_retries, delay, req.full_url)(urlopen)(
    File "C:\Python\Lib\site-packages\sklearn\datasets\_openml.py", line 103, in wrapper
    return f(*args, **kwargs)
    File "C:\Python\Lib\urllib\request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
    File "C:\Python\Lib\urllib\request.py", line 515, in open
    response = self._open(req, data)
    File "C:\Python\Lib\urllib\request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
    File "C:\Python\Lib\urllib\request.py", line 492, in _call_chain
    result = func(*args)
    File "C:\Python\Lib\urllib\request.py", line 1392, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
    File "C:\Python\Lib\urllib\request.py", line 1347, in do_open
    raise URLError(err)
    urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>

     j'ai déjà essayé ces  transactions 


    C:\Users\Workdoc>pip install Certifi

    C:\Users\Workdoc>python --version
    Python 3.12.0


    Requirement already satisfied: Certifi in c:\python\lib\site-packages (2023.7.22)

    • Partager sur Facebook
    • Partager sur Twitter

    Initiez-vous au Machine Learning

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown