IrisRainbowNeko / genshin_auto_fish

基于深度强化学习的原神自动钓鱼AI
4.76k stars 724 forks source link

请教一下,这个怎么解决? #224

Closed SouthernDreamS6 closed 2 years ago

SouthernDreamS6 commented 2 years ago

(ysfish) D:\Github\genshin_auto_fish>python fishing.py image -f yolox/exp/yolox_tiny_fish.py -c weights/yolox_tiny.pth --conf 0.25 --nms 0.45 --tsize 640 --device gpu 2022-01-12 18:04:19.150 | INFO | main:main:91 - Args: Namespace(ckpt='weights/yolox_tiny.pth', conf=0.25, demo='image', device='gpu', exp_file='yolox/exp/yolox_tiny_fish.py', experiment_name='yolox_tiny_fish', fp16=False, fuse=False, legacy=False, model_dir='./weights/fish_genshin_net.pth', n_actions=2, n_states=3, name=None, nms=0.45, path='./assets/dog.jpg', step_tick=12, trt=False, tsize=640) 2022-01-12 18:04:19.383 | INFO | main:main:101 - Model Summary: Params: 5.03M, Gflops: 15.15 2022-01-12 18:04:21.885 | INFO | main:main:114 - loading checkpoint Traceback (most recent call last): File "fishing.py", line 195, in main(exp, args) File "fishing.py", line 117, in main model.load_state_dict(ckpt["model"]) File "D:\Software\anaconda3\envs\ysfish\lib\site-packages\torch\nn\modules\module.py", line 1052, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for YOLOX: size mismatch for head.cls_preds.0.weight: copying a param with shape torch.Size([80, 96, 1, 1]) from checkpoint, the shape in current model is torch.Size([6, 96, 1, 1]). size mismatch for head.cls_preds.0.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([6]). size mismatch for head.cls_preds.1.weight: copying a param with shape torch.Size([80, 96, 1, 1]) from checkpoint, the shape in current model is torch.Size([6, 96, 1, 1]). size mismatch for head.cls_preds.1.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([6]). size mismatch for head.cls_preds.2.weight: copying a param with shape torch.Size([80, 96, 1, 1]) from checkpoint, the shape in current model is torch.Size([6, 96, 1, 1]). size mismatch for head.cls_preds.2.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([6]).

(ysfish) D:\Github\genshin_auto_fish>

LiuH-Asye commented 2 years ago

把权重由weights/yolox_tiny.pth改成weights/best_tiny3.pth,这个权重在https://github.com/7eu7d7/genshin_auto_fish/releases/tag/weights上可以找到