Setting proxy to let keras / tensorflow download required json












0















I was trying out this article.



It seems that while making prediction, keras fails to download json because of corporate proxy at line:



results = imagenet_utils.decode_predictions(preds)


The error is as follows:



Using TensorFlow backend.
* Loading Keras model and Flask starting server...please wait until server has fully started
2018-11-21 17:47:27.664222: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
* Serving Flask app "run_keras_server" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Downloading data from https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json
[2018-11-21 19:04:25,054] ERROR in app: Exception on /predict [POST]
Traceback (most recent call last):
File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1026, in _send_output
self.send(msg)
File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 964, in send
self.connect()
File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1392, in connect
super().connect()
File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "D:user123Programspythonpython-3.6.6-amd64libsocket.py", line 724, in create_connection
raise err
File "D:user123Programspythonpython-3.6.6-amd64libsocket.py", line 713, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasutilsdata_utils.py", line 222, in get_file
urlretrieve(origin, fpath, dl_progress)
File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 248, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 526, in open
response = self._open(req, data)
File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 544, in _open
'_open', req)
File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 504, in _call_chain
result = func(*args)
File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflask_compat.py", line 35, in reraise
raise value
File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "D:Maheshworkspacesignioworkspace6keras_flaskrun_keras_server.py", line 64, in predict
results = imagenet_utils.decode_predictions(preds)
File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasapplications__init__.py", line 28, in wrapper
return base_fun(*args, **kwargs)
File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasapplicationsimagenet_utils.py", line 14, in decode_predictions
*args, **kwargs)
File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskeras_applicationsimagenet_utils.py", line 228, in decode_predictions
file_hash='c2c37ea517e94d9795004a39431a14cb')
File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasutilsdata_utils.py", line 226, in get_file
raise Exception(error_msg.format(origin, e.errno, e.reason))
Exception: URL fetch failure on https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json: None -- [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
127.0.0.1 - - [21/Nov/2018 19:04:25] "[1m[35mPOST /predict HTTP/1.1[0m" 500 -


How can I set proxy for keras to let it download the desired file? Is there anyway I can manually download this file and make keras use it from filesystem location. Similar error occurred while downloading resnet50_weights_tf_dim_ordering_tf_kernels.h5. So, I manually downloaded it and specified it in the ResNet50().










share|improve this question



























    0















    I was trying out this article.



    It seems that while making prediction, keras fails to download json because of corporate proxy at line:



    results = imagenet_utils.decode_predictions(preds)


    The error is as follows:



    Using TensorFlow backend.
    * Loading Keras model and Flask starting server...please wait until server has fully started
    2018-11-21 17:47:27.664222: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
    * Serving Flask app "run_keras_server" (lazy loading)
    * Environment: production
    WARNING: Do not use the development server in a production environment.
    Use a production WSGI server instead.
    * Debug mode: off
    * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
    Downloading data from https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json
    [2018-11-21 19:04:25,054] ERROR in app: Exception on /predict [POST]
    Traceback (most recent call last):
    File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
    File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
    File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
    File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
    File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1026, in _send_output
    self.send(msg)
    File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 964, in send
    self.connect()
    File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1392, in connect
    super().connect()
    File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 936, in connect
    (self.host,self.port), self.timeout, self.source_address)
    File "D:user123Programspythonpython-3.6.6-amd64libsocket.py", line 724, in create_connection
    raise err
    File "D:user123Programspythonpython-3.6.6-amd64libsocket.py", line 713, in create_connection
    sock.connect(sa)
    TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasutilsdata_utils.py", line 222, in get_file
    urlretrieve(origin, fpath, dl_progress)
    File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 248, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
    File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 223, in urlopen
    return opener.open(url, data, timeout)
    File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 526, in open
    response = self._open(req, data)
    File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 544, in _open
    '_open', req)
    File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 504, in _call_chain
    result = func(*args)
    File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
    File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1320, in do_open
    raise URLError(err)
    urllib.error.URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflask_compat.py", line 35, in reraise
    raise value
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
    File "D:Maheshworkspacesignioworkspace6keras_flaskrun_keras_server.py", line 64, in predict
    results = imagenet_utils.decode_predictions(preds)
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasapplications__init__.py", line 28, in wrapper
    return base_fun(*args, **kwargs)
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasapplicationsimagenet_utils.py", line 14, in decode_predictions
    *args, **kwargs)
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskeras_applicationsimagenet_utils.py", line 228, in decode_predictions
    file_hash='c2c37ea517e94d9795004a39431a14cb')
    File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasutilsdata_utils.py", line 226, in get_file
    raise Exception(error_msg.format(origin, e.errno, e.reason))
    Exception: URL fetch failure on https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json: None -- [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
    127.0.0.1 - - [21/Nov/2018 19:04:25] "[1m[35mPOST /predict HTTP/1.1[0m" 500 -


    How can I set proxy for keras to let it download the desired file? Is there anyway I can manually download this file and make keras use it from filesystem location. Similar error occurred while downloading resnet50_weights_tf_dim_ordering_tf_kernels.h5. So, I manually downloaded it and specified it in the ResNet50().










    share|improve this question

























      0












      0








      0








      I was trying out this article.



      It seems that while making prediction, keras fails to download json because of corporate proxy at line:



      results = imagenet_utils.decode_predictions(preds)


      The error is as follows:



      Using TensorFlow backend.
      * Loading Keras model and Flask starting server...please wait until server has fully started
      2018-11-21 17:47:27.664222: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
      * Serving Flask app "run_keras_server" (lazy loading)
      * Environment: production
      WARNING: Do not use the development server in a production environment.
      Use a production WSGI server instead.
      * Debug mode: off
      * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
      Downloading data from https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json
      [2018-11-21 19:04:25,054] ERROR in app: Exception on /predict [POST]
      Traceback (most recent call last):
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1318, in do_open
      encode_chunked=req.has_header('Transfer-encoding'))
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1239, in request
      self._send_request(method, url, body, headers, encode_chunked)
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1285, in _send_request
      self.endheaders(body, encode_chunked=encode_chunked)
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1234, in endheaders
      self._send_output(message_body, encode_chunked=encode_chunked)
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1026, in _send_output
      self.send(msg)
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 964, in send
      self.connect()
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1392, in connect
      super().connect()
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 936, in connect
      (self.host,self.port), self.timeout, self.source_address)
      File "D:user123Programspythonpython-3.6.6-amd64libsocket.py", line 724, in create_connection
      raise err
      File "D:user123Programspythonpython-3.6.6-amd64libsocket.py", line 713, in create_connection
      sock.connect(sa)
      TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasutilsdata_utils.py", line 222, in get_file
      urlretrieve(origin, fpath, dl_progress)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 248, in urlretrieve
      with contextlib.closing(urlopen(url, data)) as fp:
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 223, in urlopen
      return opener.open(url, data, timeout)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 526, in open
      response = self._open(req, data)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 544, in _open
      '_open', req)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 504, in _call_chain
      result = func(*args)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1361, in https_open
      context=self._context, check_hostname=self._check_hostname)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1320, in do_open
      raise URLError(err)
      urllib.error.URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 2292, in wsgi_app
      response = self.full_dispatch_request()
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1815, in full_dispatch_request
      rv = self.handle_user_exception(e)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1718, in handle_user_exception
      reraise(exc_type, exc_value, tb)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflask_compat.py", line 35, in reraise
      raise value
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1813, in full_dispatch_request
      rv = self.dispatch_request()
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1799, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
      File "D:Maheshworkspacesignioworkspace6keras_flaskrun_keras_server.py", line 64, in predict
      results = imagenet_utils.decode_predictions(preds)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasapplications__init__.py", line 28, in wrapper
      return base_fun(*args, **kwargs)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasapplicationsimagenet_utils.py", line 14, in decode_predictions
      *args, **kwargs)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskeras_applicationsimagenet_utils.py", line 228, in decode_predictions
      file_hash='c2c37ea517e94d9795004a39431a14cb')
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasutilsdata_utils.py", line 226, in get_file
      raise Exception(error_msg.format(origin, e.errno, e.reason))
      Exception: URL fetch failure on https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json: None -- [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
      127.0.0.1 - - [21/Nov/2018 19:04:25] "[1m[35mPOST /predict HTTP/1.1[0m" 500 -


      How can I set proxy for keras to let it download the desired file? Is there anyway I can manually download this file and make keras use it from filesystem location. Similar error occurred while downloading resnet50_weights_tf_dim_ordering_tf_kernels.h5. So, I manually downloaded it and specified it in the ResNet50().










      share|improve this question














      I was trying out this article.



      It seems that while making prediction, keras fails to download json because of corporate proxy at line:



      results = imagenet_utils.decode_predictions(preds)


      The error is as follows:



      Using TensorFlow backend.
      * Loading Keras model and Flask starting server...please wait until server has fully started
      2018-11-21 17:47:27.664222: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
      * Serving Flask app "run_keras_server" (lazy loading)
      * Environment: production
      WARNING: Do not use the development server in a production environment.
      Use a production WSGI server instead.
      * Debug mode: off
      * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
      Downloading data from https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json
      [2018-11-21 19:04:25,054] ERROR in app: Exception on /predict [POST]
      Traceback (most recent call last):
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1318, in do_open
      encode_chunked=req.has_header('Transfer-encoding'))
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1239, in request
      self._send_request(method, url, body, headers, encode_chunked)
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1285, in _send_request
      self.endheaders(body, encode_chunked=encode_chunked)
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1234, in endheaders
      self._send_output(message_body, encode_chunked=encode_chunked)
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1026, in _send_output
      self.send(msg)
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 964, in send
      self.connect()
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 1392, in connect
      super().connect()
      File "D:user123Programspythonpython-3.6.6-amd64libhttpclient.py", line 936, in connect
      (self.host,self.port), self.timeout, self.source_address)
      File "D:user123Programspythonpython-3.6.6-amd64libsocket.py", line 724, in create_connection
      raise err
      File "D:user123Programspythonpython-3.6.6-amd64libsocket.py", line 713, in create_connection
      sock.connect(sa)
      TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasutilsdata_utils.py", line 222, in get_file
      urlretrieve(origin, fpath, dl_progress)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 248, in urlretrieve
      with contextlib.closing(urlopen(url, data)) as fp:
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 223, in urlopen
      return opener.open(url, data, timeout)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 526, in open
      response = self._open(req, data)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 544, in _open
      '_open', req)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 504, in _call_chain
      result = func(*args)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1361, in https_open
      context=self._context, check_hostname=self._check_hostname)
      File "D:user123Programspythonpython-3.6.6-amd64liburllibrequest.py", line 1320, in do_open
      raise URLError(err)
      urllib.error.URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 2292, in wsgi_app
      response = self.full_dispatch_request()
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1815, in full_dispatch_request
      rv = self.handle_user_exception(e)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1718, in handle_user_exception
      reraise(exc_type, exc_value, tb)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflask_compat.py", line 35, in reraise
      raise value
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1813, in full_dispatch_request
      rv = self.dispatch_request()
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packagesflaskapp.py", line 1799, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
      File "D:Maheshworkspacesignioworkspace6keras_flaskrun_keras_server.py", line 64, in predict
      results = imagenet_utils.decode_predictions(preds)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasapplications__init__.py", line 28, in wrapper
      return base_fun(*args, **kwargs)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasapplicationsimagenet_utils.py", line 14, in decode_predictions
      *args, **kwargs)
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskeras_applicationsimagenet_utils.py", line 228, in decode_predictions
      file_hash='c2c37ea517e94d9795004a39431a14cb')
      File "D:user123Programspythonpython-3.6.6-amd64libsite-packageskerasutilsdata_utils.py", line 226, in get_file
      raise Exception(error_msg.format(origin, e.errno, e.reason))
      Exception: URL fetch failure on https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json: None -- [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
      127.0.0.1 - - [21/Nov/2018 19:04:25] "[1m[35mPOST /predict HTTP/1.1[0m" 500 -


      How can I set proxy for keras to let it download the desired file? Is there anyway I can manually download this file and make keras use it from filesystem location. Similar error occurred while downloading resnet50_weights_tf_dim_ordering_tf_kernels.h5. So, I manually downloaded it and specified it in the ResNet50().







      python tensorflow keras






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 14:00









      aniranir

      423214




      423214
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413756%2fsetting-proxy-to-let-keras-tensorflow-download-required-json%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413756%2fsetting-proxy-to-let-keras-tensorflow-download-required-json%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          RAC Tourist Trophy