PaddleHub icon indicating copy to clipboard operation
PaddleHub copied to clipboard

下载ernie_tiny模型的时候,报错Can't connect to Hub Server: http://paddlepaddle.org.cn/paddlehub

Open zhiyongLiu1114 opened this issue 4 years ago • 6 comments

欢迎您反馈PaddleHub使用问题,非常感谢您对PaddleHub的贡献! 在留下您的问题时,辛苦您同步提供如下信息:

  • 版本、环境信息 1)PaddleHub和PaddlePaddle版本:请提供您的PaddleHub和PaddlePaddle版本号,例如PaddleHub1.4.1,PaddlePaddle1.6.2

PaddleHub2.0.0 PaddlePaddle2.0.0

2)系统环境:请您描述系统类型,例如Linux/Windows/MacOS/,python版本

  • 复现信息:如为报错,请给出复现环境、复现步骤 liunx Python 3.6.4 错误描述: 执行如下Python命令: import paddlehub as hub model = hub.Module(name='ernie_tiny', task='seq-cls', num_classes=len(MyDataset.label_list))

报错信息:

[INFO 2021-02-24 11:40:02,485 filelock.py:274] Lock 140080785034600 acquired on /root/.paddlehub/tmp/ernie_tiny [INFO 2021-02-24 11:40:02,517 filelock.py:318] Lock 140080785034600 released on /root/.paddlehub/tmp/ernie_tiny

gaierror Traceback (most recent call last) /opt/conda/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self) 159 conn = connection.create_connection( --> 160 (self._dns_host, self.port), self.timeout, **extra_kw 161 ) /opt/conda/lib/python3.6/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options) 60 ---> 61 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): 62 af, socktype, proto, canonname, sa = res /opt/conda/lib/python3.6/socket.py in getaddrinfo(host, port, family, type, proto, flags) 744 addrlist = [] --> 745 for res in _socket.getaddrinfo(host, port, family, type, proto, flags): 746 af, socktype, proto, canonname, sa = res gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred: NewConnectionError Traceback (most recent call last) /opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 676 headers=headers, --> 677 chunked=chunked, 678 ) /opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) 391 else: --> 392 conn.request(ethod, url, **httplib_request_kw) 393 /opt/conda/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked) 1238 """Send a complete request to the server.""" -> 1239 self._send_request(ethod, url, body, headers, encode_chunked) 1240 /opt/conda/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked) 1284 body = _encode(body, 'body') -> 1285 self.endheaders(body, encode_chunked=encode_chunked) 1286 /opt/conda/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked) 1233 raise CannotSendHeader() -> 1234 self._send_output(essage_body, encode_chunked=encode_chunked) 1235 /opt/conda/lib/python3.6/http/client.py in _send_output(self, message_body, encode_chunked) 1025 del self._buffer[:] -> 1026 self.send(sg) 1027 /opt/conda/lib/python3.6/http/client.py in send(self, data) 963 if self.auto_open: --> 964 self.connect() 965 else: /opt/conda/lib/python3.6/site-packages/urllib3/connection.py in connect(self) 186 def connect(self): --> 187 conn = self._new_conn() 188 self._prepare_conn(conn) /opt/conda/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self) 171 raise NewConnectionError( --> 172 self, "Failed to establish a new connection: %s" % e 173 ) NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f6718e8e710>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred: MaxRetryError Traceback (most recent call last) /opt/conda/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies) 448 retries=self.ax_retries, --> 449 timeout=timeout 450 ) /opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 724 retries = retries.increment( --> 725 ethod, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] 726 ) /opt/conda/lib/python3.6/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace) 438 if new_retry.is_exhausted(): --> 439 raise MaxRetryError(_pool, url, error or ResponseError(cause)) 440 MaxRetryError: HTTPConnectionPool(host='paddlepaddle.org.cn', port=80): Max retries exceeded with url: /paddlehub/search?environments=python_version&environments=platform_version&environments=platform_system&environments=platform_architecture&environments=platform_type&word=ernie_tiny&type=module&hub_version=2.0.0&paddle_version=2.0.0 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f6718e8e710>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred: ConnectionError Traceback (most recent call last) /opt/conda/lib/python3.6/site-packages/paddlehub/server/server_source.py in request(self, path, params) 116 try: --> 117 result = requests.get(api, params, timeout=self._timeout) 118 return result.json() /opt/conda/lib/python3.6/site-packages/requests/api.py in get(url, params, **kwargs) 75 kwargs.setdefault('allow_redirects', True) ---> 76 return request('get', url, params=params, **kwargs) 77 /opt/conda/lib/python3.6/site-packages/requests/api.py in request(method, url, **kwargs) 60 with sessions.Session() as session: ---> 61 return session.request(ethod=ethod, url=url, **kwargs) 62 /opt/conda/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 529 send_kwargs.update(settings) --> 530 resp = self.send(prep, **send_kwargs) 531 /opt/conda/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs) 642 # Send the request --> 643 r = adapter.send(request, **kwargs) 644 /opt/conda/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies) 515 --> 516 raise ConnectionError(e, request=request) 517 ConnectionError: HTTPConnectionPool(host='paddlepaddle.org.cn', port=80): Max retries exceeded with url: /paddlehub/search?environments=python_version&environments=platform_version&environments=platform_system&environments=platform_architecture&environments=platform_type&word=ernie_tiny&type=module&hub_version=2.0.0&paddle_version=2.0.0 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f6718e8e710>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred: ServerConnectionError Traceback (most recent call last) in ----> 1 odel = hub.Module(name='ernie_tiny', task='seq-cls', num_classes=len(MyDataset.label_list)) /opt/conda/lib/python3.6/site-packages/paddlehub/module/module.py in new(cls, name, directory, version, source, update, branch, **kwargs) 170 if name: 171 module = cls.init_with_name( --> 172 name=name, version=version, source=source, update=update, branch=branch, **kwargs) 173 CacheUpdater("update_cache", odule=name, version=version).start() 174 elif directory: /opt/conda/lib/python3.6/site-packages/paddlehub/module/module.py in init_with_name(cls, name, version, source, update, branch, **kwargs) 261 user_module_cls = anager.search(name, source=source, branch=branch) 262 if not user_module_cls or not user_module_cls.version.atch(version): --> 263 user_module_cls = anager.install(name=name, version=version, source=source, update=update, branch=branch) 264 265 directory = anager._get_normalized_path(user_module_cls.name) /opt/conda/lib/python3.6/site-packages/paddlehub/module/manager.py in install(self, name, directory, archive, url, version, source, update, branch) 186 if source: 187 return self._install_from_source(name, version, source, update, branch) --> 188 return self._install_from_name(name, version) 189 elif directory: 190 return self._install_from_directory(directory) /opt/conda/lib/python3.6/site-packages/paddlehub/module/manager.py in _install_from_name(self, name, version) 258 def _install_from_name(self, name: str, version: str = None) -> HubModule: 259 '''Install HubModule by name search result''' --> 260 result = odule_server.search_module(name=name, version=version) 261 for item in result: 262 if name.lower() == item['name'].lower() and utils.Version(item['version']).atch(version): /opt/conda/lib/python3.6/site-packages/paddlehub/server/server.py in search_module(self, name, version, source, update, branch) 86 ''' 87 return self.search_resource( ---> 88 type='module', name=name, version=version, source=source, update=update, branch=branch) 89 90 def search_resource(self, /opt/conda/lib/python3.6/site-packages/paddlehub/server/server.py in search_resource(self, type, name, version, source, update, branch) 111 source.checkout(branch) 112 --> 113 result = source.search_resource(name=name, type=type, version=version) 114 if result: 115 return result /opt/conda/lib/python3.6/site-packages/paddlehub/server/server_source.py in search_resource(self, type, name, version) 75 params['paddle_version'] = paddle.version.split('-')[0] 76 ---> 77 result = self.request(path='search', params=params) 78 if result['status'] == 0 and len(result['data']) > 0: 79 return result['data'] /opt/conda/lib/python3.6/site-packages/paddlehub/server/server_source.py in request(self, path, params) 118 return result.json() 119 except requests.exceptions.ConnectionError as e: --> 120 raise ServerConnectionError(self._url) 121 122 def is_connected(self): ServerConnectionError: Can't connect to Hub Server: http://paddlepaddle.org.cn/paddlehub

ServerConnectionError Can't connect to Hub Server: http://paddlepaddle.org.cn/paddlehub

说明:计算机网络没有问题 image

zhiyongLiu1114 avatar Feb 24 '21 03:02 zhiyongLiu1114

image 我执行这个是unsuccessfully

zhiyongLiu1114 avatar Feb 24 '21 08:02 zhiyongLiu1114

可以ping到http://paddlepaddle.org.cn/paddlehub吗

ShenYuhan avatar Feb 24 '21 08:02 ShenYuhan

可以ping到http://paddlepaddle.org.cn/paddlehub吗

ping 不到 image

zhiyongLiu1114 avatar Feb 24 '21 08:02 zhiyongLiu1114

同问,为啥互联网都能访问,却一直报网络连接失败的错,我在公司的服务器上挂代理也是这个样子,在家自己电脑连无线也是。

0sxw0 avatar Jun 26 '22 12:06 0sxw0

这问题有人解吗?

iarno avatar Jun 28 '22 15:06 iarno

这问题有人解吗?

我现在都用他们开发的from pretrained函数加载模型了

zhiyongLiu1114 avatar Jun 29 '22 01:06 zhiyongLiu1114