IDEA-Research / GroundingDINO

[ECCV 2024] Official implementation of the paper "Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection"
https://arxiv.org/abs/2303.05499
Apache License 2.0
6.44k stars 662 forks source link

[Errno 2] No such file tokenizer_config.json #337

Open RCLaplace opened 3 months ago

RCLaplace commented 3 months ago

while using the load_model function, I encountered an issue exporting the operator 'FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\v_ztfang\.cache\huggingface\hub\models--bert-base-uncased\snapshots\86b5e0934494bd15c9632b12f734a8a67f723594\tokenizer_config.json'

It seem to be an error occurring while downloading tokenizer_config.json file from Huggingface, but I can see in the terminal output that the tokenizer_config.json file is downloaded to 100% After the download was complete, I looked for its folder and found that all the paths were there except for the After the download was complete, I looked for its folder and found that it was all there, but there was no tokenizer_config.json

Thank you for your time and assistance.

Versions Pytorch : 2.3.0 CUDA: 12.01

The code involved: model = load_model("groundingdino/config/GroundingDINO_SwinT_OGC.py", "weights/groundingdino_swint_ogc.pth")

Terminal output: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:3588.) final text_encoder_type: bert-base-uncased tokenizer_config.json: 100%|██████████████████████████████████████████████████████████████████████████████████████| 48.0/48.0 [00:00<00:00, 12.0kB/s] Traceback (most recent call last): File "D:\work\2024\6\GroundingDINO\demo.py", line 14, in model = load_model("groundingdino/config/GroundingDINO_SwinT_OGC.py", "weights/groundingdino_swint_ogc.pth") File "D:\work\2024\6\GroundingDINO\groundingdino\util\inference.py", line 32, in load_model model = build_model(args) File "D:\work\2024\6\GroundingDINO\groundingdino\models__init__.py", line 17, in build_model model = build_func(args) File "D:\work\2024\6\GroundingDINO\groundingdino\models\GroundingDINO\groundingdino.py", line 388, in build_groundingdino model = GroundingDINO( File "D:\work\2024\6\GroundingDINO\groundingdino\models\GroundingDINO\groundingdino.py", line 107, in init self.tokenizer = get_tokenlizer.get_tokenlizer(text_encoder_type) File "D:\work\2024\6\GroundingDINO\groundingdino\util\get_tokenlizer.py", line 19, in get_tokenlizer tokenizer = AutoTokenizer.from_pretrained(text_encoder_type) File "E:\software\VS2019\env\0\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 817, in from_pretrained tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs) File "E:\software\VS2019\env\0\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 670, in get_tokenizer_config with open(resolved_config_file, encoding="utf-8") as reader: FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\v_ztfang\.cache\huggingface\hub\models--bert-base-uncased\snapshots\86b5e0934494bd15c9632b12f734a8a67f723594\tokenizer_config.json'

liyan1997 commented 3 months ago

代码修改项 下载不了应该是网络的问题,猜测你大概也是中国人,我昨天也刚遇到这个问题,你试试这个方法吧,我自己鼓捣的,我的问题解决了,看你运气了

ZYJIQVV commented 2 months ago

@liyan1997 蟹蟹!救了大命了