sacdallago / bio_embeddings

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

Getting HTTP 406 error when sequence emedding. #163

Closed rjtevon closed 3 years ago

rjtevon commented 3 years ago

When trying to embed a simple sequence,

from bio_embeddings.embed import SeqVecEmbedder, ProtTransBertBFDEmbedder

embedders = []
sequence = 'SEQVENCE'

embedders.append(ProtTransBertBFDEmbedder())
embedders.append(SeqVecEmbedder())

I get:

>>> HTTPError: HTTP Error 406: Not Acceptable

Included the full traceback below. Note that that traceback was when commenting out the ProtTrans embedder -- I get the same error on both.

Full traceback weights.hdf5: 0.00B [00:00, ?B/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) in 8 ##embedders.append(ProtTransBertBFDEmbedder()) 9 ---> 10 embedders.append(SeqVecEmbedder()) 11 12 embeddings = [] ~/anaconda3/lib/python3.8/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 ~/anaconda3/lib/python3.8/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 ~/anaconda3/lib/python3.8/site-packages/bio_embeddings/utilities/remote_file_retriever.py in get_model_file(model, file, overwrite_cache) 111 unit="B", unit_scale=True, miniters=1, desc=url.split("/")[-1] 112 ) as t: --> 113 request.urlretrieve(url, filename=temp_file.name, reporthook=t.update_to) 114 115 return str(cache_path) ~/anaconda3/lib/python3.8/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 ~/anaconda3/lib/python3.8/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): ~/anaconda3/lib/python3.8/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 ~/anaconda3/lib/python3.8/urllib/request.py in http_response(self, request, response) 638 # request was successfully received, understood, and accepted. 639 if not (200 <= code < 300): --> 640 response = self.parent.error( 641 'http', request, response, code, msg, hdrs) 642 ~/anaconda3/lib/python3.8/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 ~/anaconda3/lib/python3.8/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args) 500 for handler in handlers: 501 func = getattr(handler, meth_name) --> 502 result = func(*args) 503 if result is not None: 504 return result ~/anaconda3/lib/python3.8/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
konstin commented 3 years ago

Our hosting provider changed their configuration, see #156. This should be fixed in v0.2.2