RuntimeError: Internal: /sentencepiece/src/sentencepiece_processor.cc(818) [model_proto->ParseFromArray(serialized.data(), serialized.size())] 
# ❓ When I used transformers based on jupyter, it can't get vocab,but  the function AlbertModel.from_pretrained  is available

**CODE:**
from transformers import AlbertTokenizer, AlbertModel
import torch
tokenizer = AlbertTokenizer.from_pretrained("./albert-v1/vocab.txt")

**The following error occurs:**

Calling AlbertTokenizer.from_pretrained() with the path to a single file or url is deprecated
------------------------------------------------------------------
RuntimeError                     Traceback (most recent call last)
<ipython-input-10-bf78623a6e4a> in <module>
----> 1 tokenizer = AlbertTokenizer.from_pretrained("./albert-v1/vocab.txt")

~/anaconda3/lib/python3.7/site-packages/transformers/tokenization_utils_base.py in from_pretrained(cls, *inputs, **kwargs)
   1138 
   1139         """
-> 1140         return cls._from_pretrained(*inputs, **kwargs)
   1141 
   1142     @classmethod

~/anaconda3/lib/python3.7/site-packages/transformers/tokenization_utils_base.py in _from_pretrained(cls, pretrained_model_name_or_path, *init_inputs, **kwargs)
   1285         # Instantiate tokenizer.
   1286         try:
-> 1287             tokenizer = cls(*init_inputs, **init_kwargs)
   1288         except OSError:
   1289             raise OSError(

~/anaconda3/lib/python3.7/site-packages/transformers/tokenization_albert.py in __init__(self, vocab_file, do_lower_case, remove_space, keep_accents, bos_token, eos_token, unk_token, sep_token, pad_token, cls_token, mask_token, **kwargs)
    153 
    154         self.sp_model = spm.SentencePieceProcessor()
--> 155         self.sp_model.Load(vocab_file)
    156 
    157     @property

~/anaconda3/lib/python3.7/site-packages/sentencepiece.py in Load(self, model_file, model_proto)
    365       if model_proto:
    366         return self.LoadFromSerializedProto(model_proto)
--> 367       return self.LoadFromFile(model_file)
    368 
    369 

~/anaconda3/lib/python3.7/site-packages/sentencepiece.py in LoadFromFile(self, arg)
    175 
    176     def LoadFromFile(self, arg):
--> 177         return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
    178 
    179     def Init(self,

RuntimeError: Internal: /sentencepiece/src/sentencepiece_processor.cc(818) [model_proto->ParseFromArray(serialized.data(), serialized.size())] 


![image](https://user-images.githubusercontent.com/50441790/92065758-cf984780-edd2-11ea-8774-6a9dd5f27b16.png)



The `AlbertTokenizer` in `transformers` is a SentencePiece based tokenizer, so it cannot load `vocab.txt`. You could try loading it in `BertTokenizer`, as it seems to be a wordpiece tokenizer vocabulary.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
