mvasil / fashion-compatibility

Learning Type-Aware Embeddings for Fashion Compatibility
BSD 3-Clause "New" or "Revised" License
152 stars 42 forks source link

error while training #34

Open monib110 opened 1 year ago

monib110 commented 1 year ago

Hi When I try to train the model, I got this error:

`Downloading: "https://download.pytorch.org/models/resnet18-5c106cde.pth" to /root/.cache/torch/hub/checkpoints/resnet18-5c106cde.pth

gaierror Traceback (most recent call last) /opt/conda/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1349 h.request(req.get_method(), req.selector, req.data, headers, -> 1350 encode_chunked=req.has_header('Transfer-encoding')) 1351 except OSError as err: # timeout error

/opt/conda/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked) 1280 """Send a complete request to the server.""" -> 1281 self._send_request(method, url, body, headers, encode_chunked) 1282

/opt/conda/lib/python3.7/http/client.py in _send_request(self, method, url, body, headers, encode_chunked) 1326 body = _encode(body, 'body') -> 1327 self.endheaders(body, encode_chunked=encode_chunked) 1328

/opt/conda/lib/python3.7/http/client.py in endheaders(self, message_body, encode_chunked) 1275 raise CannotSendHeader() -> 1276 self._send_output(message_body, encode_chunked=encode_chunked) 1277

/opt/conda/lib/python3.7/http/client.py in _send_output(self, message_body, encode_chunked) 1035 del self._buffer[:] -> 1036 self.send(msg) 1037

/opt/conda/lib/python3.7/http/client.py in send(self, data) 975 if self.auto_open: --> 976 self.connect() 977 else:

/opt/conda/lib/python3.7/http/client.py in connect(self) 1442 -> 1443 super().connect() 1444

/opt/conda/lib/python3.7/http/client.py in connect(self) 947 self.sock = self._create_connection( --> 948 (self.host,self.port), self.timeout, self.source_address) 949 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

/opt/conda/lib/python3.7/socket.py in create_connection(address, timeout, source_address) 706 err = None --> 707 for res in getaddrinfo(host, port, 0, SOCK_STREAM): 708 af, socktype, proto, canonname, sa = res

/opt/conda/lib/python3.7/socket.py in getaddrinfo(host, port, family, type, proto, flags) 751 addrlist = [] --> 752 for res in _socket.getaddrinfo(host, port, family, type, proto, flags): 753 af, socktype, proto, canonname, sa = res

gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

URLError Traceback (most recent call last) /tmp/ipykernel_27/37231806.py in 341 342 if name == 'main': --> 343 main()

/tmp/ipykernel_27/37231806.py in main() 133 batch_size=args.batch_size, shuffle=False, **kwargs) 134 --> 135 model = resnet18(pretrained=True, embedding_size=args.dim_embed) 136 csn_model = TypeSpecificNet(args, model, len(test_loader.dataset.typespaces)) 137

/kaggle/working/Resnet_18.py in resnet18(pretrained, **kwargs) 116 if pretrained: 117 state = model.state_dict() --> 118 loaded_state_dict = model_zoo.load_url(model_urls['resnet18']) 119 for k in loaded_state_dict: 120 if k in state:

/opt/conda/lib/python3.7/site-packages/torch/hub.py in load_state_dict_from_url(url, model_dir, map_location, progress, check_hash, file_name) 589 r = HASH_REGEX.search(filename) # r is Optional[Match[str]] 590 hash_prefix = r.group(1) if r else None --> 591 download_url_to_file(url, cached_file, hash_prefix, progress=progress) 592 593 if _is_legacy_zip_format(cached_file):

/opt/conda/lib/python3.7/site-packages/torch/hub.py in download_url_to_file(url, dst, hash_prefix, progress) 455 file_size = None 456 req = Request(url, headers={"User-Agent": "torch.hub"}) --> 457 u = urlopen(req) 458 meta = u.info() 459 if hasattr(meta, 'getheaders'):

/opt/conda/lib/python3.7/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context) 220 else: 221 opener = _opener --> 222 return opener.open(url, data, timeout) 223 224 def install_opener(opener):

/opt/conda/lib/python3.7/urllib/request.py in open(self, fullurl, data, timeout) 523 req = meth(req) 524 --> 525 response = self._open(req, data) 526 527 # post-process response

/opt/conda/lib/python3.7/urllib/request.py in _open(self, req, data) 541 protocol = req.type 542 result = self._call_chain(self.handle_open, protocol, protocol + --> 543 '_open', req) 544 if result: 545 return result

/opt/conda/lib/python3.7/urllib/request.py in _call_chain(self, chain, kind, meth_name, args) 501 for handler in handlers: 502 func = getattr(handler, meth_name) --> 503 result = func(args) 504 if result is not None: 505 return result

/opt/conda/lib/python3.7/urllib/request.py in https_open(self, req) 1391 def https_open(self, req): 1392 return self.do_open(http.client.HTTPSConnection, req, -> 1393 context=self._context, check_hostname=self._check_hostname) 1394 1395 https_request = AbstractHTTPHandler.dorequest

/opt/conda/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1350 encode_chunked=req.has_header('Transfer-encoding')) 1351 except OSError as err: # timeout error -> 1352 raise URLError(err) 1353 r = h.getresponse() 1354 except:

URLError: <urlopen error [Errno -3] Temporary failure in name resolution>`

Could any one help me?