wukevin / tcr-bert

Large language modeling applied to T-cell receptor (TCR) sequences.
Apache License 2.0
47 stars 7 forks source link

AssertionError for get_tape_embedding #7

Open a96123155 opened 1 year ago

a96123155 commented 1 year ago

Hi, when I run './tcr-bert/jupyter/transformers_glanville_classifier_and_clustering.ipynb', the TAPE embedding faced some wrong:

INFO:root:TAPE command: CUDA_VISIBLE_DEVICES=2 tape-embed unirep /tmp/tmp423qozu0/input.fasta /tmp/tmp423qozu0/output.npz babbler-1900 --tokenizer unirep --seed 1234
Traceback (most recent call last):
  File "/home/ubuntu/tcr-bert/jupyter/transformers_glanville_classifier_and_clustering复现.py", line 359, in <module>
    tape_train_embed = model_utils.get_tape_embedding(train_trbs, device=2)
  File "/home/ubuntu/tcr-bert/tcr/model_utils.py", line 637, in get_tape_embedding
    assert retcode == 0
AssertionError

Then, I check the

(tcrbert) ubuntu@ip:~/tcr-bert/jupyter$ CUDA_VISIBLE_DEVICES=2 tape-embed unirep try.fasta tape_output.npz babbler-1900 --tokenizer unirep --seed 1234
23/02/20 19:38:25 - INFO - tape.training -   device: cuda n_gpu: 1
23/02/20 19:38:25 - INFO - tape.models.modeling_utils -   loading configuration file https://s3.amazonaws.com/proteindata/pytorch-models/unirep-base-config.json from cache at /home/ubuntu/.cache/torch/protein_models/f61813e6c3d93a4e696443982bbca4bfffa259c4abe29dfe680566d72861f512
Traceback (most recent call last):
  File "/home/ubuntu/.conda/envs/tcrbert/bin/tape-embed", line 8, in <module>
    sys.exit(run_embed())
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/site-packages/tape/main.py", line 234, in run_embed
    training.run_embed(**embed_args)
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/site-packages/tape/training.py", line 628, in run_embed
    model = registry.get_task_model(
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/site-packages/tape/registry.py", line 217, in get_task_model
    model = model_cls.from_pretrained(load_dir, num_labels=task_spec.num_labels)
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/site-packages/tape/models/modeling_utils.py", line 466, in from_pretrained
    config, model_kwargs = cls.config_class.from_pretrained(
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/site-packages/tape/models/modeling_utils.py", line 171, in from_pretrained
    config = cls.from_json_file(resolved_config_file)
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/site-packages/tape/models/modeling_utils.py", line 201, in from_json_file
    return cls.from_dict(json.loads(text))
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/ubuntu/.conda/envs/tcrbert/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

What Can I do? Thank you.

Best regards