kdexd / virtex

[CVPR 2021] VirTex: Learning Visual Representations from Textual Annotations
http://kdexd.xyz/virtex
MIT License
556 stars 61 forks source link

Wrong URL for downloading weights #3

Closed soumilkanwal80 closed 4 years ago

soumilkanwal80 commented 4 years ago

import virtex.model_zoo as mz model = mz.get("width_ablations/bicaptioning_R_50_L1_H2048.yaml", pretrained=True)

When I run this script I get the following HTTP Error: `HTTPError Traceback (most recent call last)

in () 1 import virtex 2 import virtex.model_zoo as mz ----> 3 model = mz.get("width_ablations/bicaptioning_R_50_L1_H2048.yaml", pretrained=True) 18 frames /content/virtex/virtex/model_zoo/model_zoo.py in get(config_path, pretrained) 98 checkpoint_url, 99 dir=os.path.expanduser("~/.torch/virtex_cache"), --> 100 filename=os.path.basename(config_path).replace(".yaml", ".pth") 101 ) 102 CheckpointManager(model=model).load(checkpoint_path) /usr/local/lib/python3.6/dist-packages/fvcore/common/download.py in download(url, dir, filename, progress) 56 unit="B", unit_scale=True, miniters=1, desc=filename, leave=True 57 ) as t: ---> 58 tmp, _ = request.urlretrieve(url, filename=tmp, reporthook=hook(t)) 59 60 else: /usr/lib/python3.6/urllib/request.py in urlretrieve(url, filename, reporthook, data) 246 url_type, path = splittype(url) 247 --> 248 with contextlib.closing(urlopen(url, data)) as fp: 249 headers = fp.info() 250 /usr/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context) 221 else: 222 opener = _opener --> 223 return opener.open(url, data, timeout) 224 225 def install_opener(opener): /usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout) 530 for processor in self.process_response.get(protocol, []): 531 meth = getattr(processor, meth_name) --> 532 response = meth(req, response) 533 534 return response /usr/lib/python3.6/urllib/request.py in http_response(self, request, response) 640 if not (200 <= code < 300): 641 response = self.parent.error( --> 642 'http', request, response, code, msg, hdrs) 643 644 return response /usr/lib/python3.6/urllib/request.py in error(self, proto, *args) 562 http_err = 0 563 args = (dict, proto, meth_name) + args --> 564 result = self._call_chain(*args) 565 if result: 566 return result /usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args) 502 for handler in handlers: 503 func = getattr(handler, meth_name) --> 504 result = func(*args) 505 if result is not None: 506 return result /usr/lib/python3.6/urllib/request.py in http_error_302(self, req, fp, code, msg, headers) 754 fp.close() 755 --> 756 return self.parent.open(new, timeout=req.timeout) 757 758 http_error_301 = http_error_303 = http_error_307 = http_error_302 /usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout) 530 for processor in self.process_response.get(protocol, []): 531 meth = getattr(processor, meth_name) --> 532 response = meth(req, response) 533 534 return response /usr/lib/python3.6/urllib/request.py in http_response(self, request, response) 640 if not (200 <= code < 300): 641 response = self.parent.error( --> 642 'http', request, response, code, msg, hdrs) 643 644 return response /usr/lib/python3.6/urllib/request.py in error(self, proto, *args) 562 http_err = 0 563 args = (dict, proto, meth_name) + args --> 564 result = self._call_chain(*args) 565 if result: 566 return result /usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args) 502 for handler in handlers: 503 func = getattr(handler, meth_name) --> 504 result = func(*args) 505 if result is not None: 506 return result /usr/lib/python3.6/urllib/request.py in http_error_302(self, req, fp, code, msg, headers) 754 fp.close() 755 --> 756 return self.parent.open(new, timeout=req.timeout) 757 758 http_error_301 = http_error_303 = http_error_307 = http_error_302 /usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout) 530 for processor in self.process_response.get(protocol, []): 531 meth = getattr(processor, meth_name) --> 532 response = meth(req, response) 533 534 return response /usr/lib/python3.6/urllib/request.py in http_response(self, request, response) 640 if not (200 <= code < 300): 641 response = self.parent.error( --> 642 'http', request, response, code, msg, hdrs) 643 644 return response /usr/lib/python3.6/urllib/request.py in error(self, proto, *args) 568 if http_err: 569 args = (dict, 'default', 'http_error_default') + orig_args --> 570 return self._call_chain(*args) 571 572 # XXX probably also want an abstract factory that knows when it makes /usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args) 502 for handler in handlers: 503 func = getattr(handler, meth_name) --> 504 result = func(*args) 505 if result is not None: 506 return result /usr/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs) 648 class HTTPDefaultErrorHandler(BaseHandler): 649 def http_error_default(self, req, fp, code, msg, hdrs): --> 650 raise HTTPError(req.full_url, code, msg, hdrs, fp) 651 652 class HTTPRedirectHandler(BaseHandler): HTTPError: HTTP Error 404: Not Found`

I think its because the URL is not being generated correctly there is an extra '/' Failed to download https://umich.box.com/shared/static//fm1nq819q74vr0kqcd3gkivlzf06xvko.pth

kdexd commented 4 years ago

Thanks for pointing this out! Can't recall how this slipped by. Please pull from master now and it should work. Feel free to reopen this issue if it doesn't.