Traceback (most recent call last):
File "train.py", line 148, in
train(opt.cfg)
File "train.py", line 46, in train
model = model_.model_dict[model_name](classes, drop_rate, share_weight=False, pretrained=True)
File "/mnt/mountA/xhy/SUES200/SUES-200-Benchmark-master/model_.py", line 53, in init
self.model_1 = timm.create_model("resnet50", pretrained=pretrained, num_classes=0)
File "/home/gaofen/.conda/envs/xhypy3.7/lib/python3.7/site-packages/timm/models/_factory.py", line 121, in create_model
**kwargs,
File "/home/gaofen/.conda/envs/xhypy3.7/lib/python3.7/site-packages/timm/models/resnet.py", line 1334, in resnet50
return _create_resnet('resnet50', pretrained, **dict(model_args, **kwargs))
File "/home/gaofen/.conda/envs/xhypy3.7/lib/python3.7/site-packages/timm/models/resnet.py", line 584, in _create_resnet
return build_model_with_cfg(ResNet, variant, pretrained, **kwargs)
File "/home/gaofen/.conda/envs/xhypy3.7/lib/python3.7/site-packages/timm/models/_builder.py", line 403, in build_model_with_cfg
strict=pretrained_strict,
File "/home/gaofen/.conda/envs/xhypy3.7/lib/python3.7/site-packages/timm/models/_builder.py", line 190, in load_pretrained
state_dict = load_state_dict_from_hf(pretrained_loc)
File "/home/gaofen/.conda/envs/xhypy3.7/lib/python3.7/site-packages/timm/models/_hub.py", line 188, in load_state_dict_from_hf
cached_file = hf_hub_download(hf_model_id, filename=filename, revision=hf_revision)
File "/home/gaofen/.conda/envs/xhypy3.7/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
File "/home/gaofen/.conda/envs/xhypy3.7/lib/python3.7/site-packages/huggingface_hub/file_download.py", line 1292, in hf_hub_download
"Connection error, and we cannot find the requested files in"
huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on.
感谢您的优秀工作,对我很有启发,我在运行您的代码时遇到了huggingface网站下载不了resnet的问题,我猜测是因为实验室服务器上没有vpn导致的。我在自己电脑上下载了resnet50的model.safetensors和pytorch_model.bin并上传到服务器上,但是不知道项目中代码要改哪里?或许您有更好的解决办法么,非常感谢您的工作~
非常感谢您对本项目的关注。我认为本问题这是由于timm的版本问题,该库在0.9.X的版本后引入了huggingface,请尝试将timm版本降级至0.6.X后再使用本项目。