sacdallago / bio_embeddings

Get protein embeddings from protein sequences
http://docs.bioembeddings.com
MIT License
461 stars 65 forks source link

HTTP Error 406: Not Acceptable when downloading model #159

Closed victormaricato closed 3 years ago

victormaricato commented 3 years ago

When I instanciate a model

from bio_embeddings.embed import SeqVecEmbedder
SeqVecEmbedder()

I get HTTP Error 406: Not Acceptable

Full stack-trace ``` weights.hdf5: 0.00B [00:00, ?B/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) /tmp/ipykernel_19363/2484751941.py in ----> 1 SeqVecEmbedder() /opt/conda/lib/python3.7/site-packages/bio_embeddings/embed/seqvec_embedder.py in __init__(self, warmup_rounds, **kwargs) 43 :param max_amino_acids: max # of amino acids to include in embed_many batches. Default: 15k AA 44 """ ---> 45 super().__init__(**kwargs) 46 47 # Get file locations from kwargs /opt/conda/lib/python3.7/site-packages/bio_embeddings/embed/embedder_interfaces.py in __init__(self, device, **kwargs) 52 for file in self.necessary_files: 53 if not self._options.get(file): ---> 54 self._options[file] = get_model_file(model=self.name, file=file) 55 files_loaded += 1 56 /opt/conda/lib/python3.7/site-packages/bio_embeddings/utilities/remote_file_retriever.py in get_model_file(model, file, overwrite_cache) 111 return str(cache_path) /opt/conda/lib/python3.7/urllib/request.py in urlretrieve(url, filename, reporthook, data) 245 url_type, path = splittype(url) 246 --> 247 with contextlib.closing(urlopen(url, data)) as fp: 248 headers = fp.info() 249 /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) 529 for processor in self.process_response.get(protocol, []): 530 meth = getattr(processor, meth_name) --> 531 response = meth(req, response) 532 533 return response /opt/conda/lib/python3.7/urllib/request.py in http_response(self, request, response) 639 if not (200 <= code < 300): 640 response = self.parent.error( --> 641 'http', request, response, code, msg, hdrs) 642 643 return response /opt/conda/lib/python3.7/urllib/request.py in error(self, proto, *args) 567 if http_err: 568 args = (dict, 'default', 'http_error_default') + orig_args --> 569 return self._call_chain(*args) 570 571 # XXX probably also want an abstract factory that knows when it makes /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 http_error_default(self, req, fp, code, msg, hdrs) 647 class HTTPDefaultErrorHandler(BaseHandler): 648 def http_error_default(self, req, fp, code, msg, hdrs): --> 649 raise HTTPError(req.full_url, code, msg, hdrs, fp) 650 651 class HTTPRedirectHandler(BaseHandler): HTTPError: HTTP Error 406: Not Acceptable ```

Happens just after the clean install of bio-embeddings[all].

victormaricato commented 3 years ago

Closing as it is a duplicate of https://github.com/sacdallago/bio_embeddings/issues/156