FeiElysia/ViECap

GPT2的预训练模型加载问题

Closed this issue · 2 comments

尊敬的作者您好,我在运行train_coco.sh时遇到如下问题,请问该如何解决呢?
我想应该是加载GPT2预训练模型权重的问题,我搜索尝试了很多方法但都无效,希望您能解答一下,谢谢!
Traceback (most recent call last):
File "main.py", line 168, in
main()
File "main.py", line 152, in main
datasets = CaptionsDataset(
File "/private/ViECap-main/CaptionsDataset.py", line 31, in init
tokenizer = AutoTokenizer.from_pretrained(language_model)
File "/root/anaconda3/envs/Viecap/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 498, in from_pretrained
tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
File "/root/anaconda3/envs/Viecap/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 359, in get_tokenizer_config
resolved_config_file = get_file_from_repo(
File "/root/anaconda3/envs/Viecap/lib/python3.8/site-packages/transformers/utils/hub.py", line 678, in get_file_from_repo
resolved_file = cached_path(
File "/root/anaconda3/envs/Viecap/lib/python3.8/site-packages/transformers/utils/hub.py", line 282, in cached_path
output_path = get_from_cache(
File "/root/anaconda3/envs/Viecap/lib/python3.8/site-packages/transformers/utils/hub.py", line 545, in get_from_cache
raise ValueError(
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.

Feel free to download the model card from huggingface (https://huggingface.co/gpt2) directly using your own computer (using a proxy, i.e., VPN, is required here). Then, upload the downloaded model card to your server and set language_model to the path of model card (or do not change the arg of lanague_model and upload model card to the root directory of ViECap)

Nice, Thank you for your patient reply !😀