Closed lyb18758 closed 3 months ago
What is the naming of the weights you are loading? Please ensure that the loaded weight names contain the keyword 'clip4str'.
What is the naming of the weights you are loading? Please ensure that the loaded weight names contain the keyword 'clip4str'.
载入的是clip4str_b_plus.ckpt,从inference中提供的百度网盘链接下载来的
全部报错信息如下
python test.py --checkpoint clip4str_b_plus.ckpt --data_root test --clip_model_path ViT-B-16.pt
Namespace(alpha=0.1, batch_size=128, cased=False, checkpoint='clip4str_b_plus.ckpt', clip_model_path='ViT-B-16.pt', clip_refine=False, data_root='test', device='cuda', new=False, num_workers=4, punctuation=False, rotation=0, sample_K=5, sample_K2=5, sample_prompt=None, sample_total=50)
Additional keyword arguments: {'charset_test': '0123456789abcdefghijklmnopqrstuvwxyz'}
load weights from checkpoint clip4str_b_plus.ckpt
config of VL4STR: image_freeze_nlayer: -1, text_freeze_nlayer: 6, freeze_language_backbone: False, freeze_image_backbone: False use_language_model: True, context_length: 16, cross_token_embeding: False, cross_loss_weight: 1.0 use_share_dim: True, image_detach: True cross_gt_context: True, cross_cloze_mask: False, cross_fast_decode: False
Traceback (most recent call last):
File "test.py", line 174, in
"Please create a new folder named clip
in the working directory and place the ViT-B-16.pt
file inside the clip
folder. Then execute the following command again:
python test.py --checkpoint clip4str_b_plus.ckpt --data_root test --clip_model_path clip/ViT-B-16.pt
"Please create a new folder named
clip
in the working directory and place theViT-B-16.pt
file inside theclip
folder. Then execute the following command again:python test.py --checkpoint clip4str_b_plus.ckpt --data_root test --clip_model_path clip/ViT-B-16.pt
ok 成功了 谢谢
下载并且载入权重了但是报了这个错误,请问是什么原因呢 Traceback (most recent call last): File "test.py", line 174, in
main()
File "D:\Anaconda\envs\lm\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context
return func(*args, kwargs)
File "test.py", line 102, in main
model = load_from_checkpoint(args.checkpoint, kwargs).eval().to(args.device)
File "D:\pythonProject\lm\strhub\models\utils.py", line 112, in load_from_checkpoint
raise InvalidModelError("No configuration found for '{}'".format(experiment)) from None
strhub.models.utils.InvalidModelError: No configuration found for 'vl4str'