Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol prottrans_bert_bfd: OSError: Unable to load weights from pytorch checkpoint file for .catch/bio_embeddings/prottrans_bert_bfd/model_directory/pytorch_model.bin' at '.catch/bio_embeddings/prottrans_bert_bfd/model_directory/pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. #242

Open
Meng-AnunaAI opened this issue Jan 25, 2024 · 0 comments

Comments

@Meng-AnunaAI
Copy link

Metadata

key value
version 0.2.2
cuda False

Parameter

key value
type embed
protocol prottrans_bert_bfd
reduce True
discard_per_amino_acid_embeddings True

Traceback

Traceback (most recent call last):
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/transformers/modeling_utils.py", line 533, in load_state_dict
    return torch.load(
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/torch/serialization.py", line 608, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/torch/serialization.py", line 777, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
**TypeError: 'weights_only' is an invalid keyword argument for load()**

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/transformers/modeling_utils.py", line 542, in load_state_dict
    if f.read(7) == "version":
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/bio_embeddings/utilities/pipeline.py", line 284, in execute_pipeline_from_config
    stage_output_parameters = stage_runnable(**stage_parameters)
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/bio_embeddings/embed/pipeline.py", line 400, in run
    embedder: EmbedderInterface = embedder_class(**result_kwargs)
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/bio_embeddings/embed/prottrans_bert_bfd_embedder.py", line 36, in __init__
    self._model = BertModel.from_pretrained(self._model_directory)
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/transformers/modeling_utils.py", line 3527, in from_pretrained
    state_dict = load_state_dict(resolved_archive_file)
  File "/home/mengma/miniconda3/envs/Interactome/lib/python3.8/site-packages/transformers/modeling_utils.py", line 554, in load_state_dict
    raise OSError(
OSError: Unable to load weights from pytorch checkpoint file for '/home/mengma/.cache/bio_embeddings/prottrans_bert_bfd/model_directory/pytorch_model.bin' at '/home/mengma/.cache/bio_embeddings/prottrans_bert_bfd/model_directory/pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

More info

@Meng-AnunaAI Meng-AnunaAI changed the title Protocol prottrans_bert_bfd: OSError: Unable to load weights from pytorch checkpoint file for '/home/mengma/.cache/bio_embeddings/prottrans_bert_bfd/model_directory/pytorch_model.bin' at '/home/mengma/.cache/bio_embeddings/prottrans_bert_bfd/model_directory/pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. Protocol prottrans_bert_bfd: OSError: Unable to load weights from pytorch checkpoint file for .catch/bio_embeddings/prottrans_bert_bfd/model_directory/pytorch_model.bin' at '.catch/bio_embeddings/prottrans_bert_bfd/model_directory/pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant