LittleMio / Genshin_auto_fish

原神自动钓鱼AI
https://github.com/7eu7d7/genshin_auto_fish
79 stars 12 forks source link

loading checkpoint 报错 #2

Closed liahua closed 2 years ago

liahua commented 2 years ago

C:\ProgramData\Anaconda3\envs\ysfish\lib\site-packages\torch\functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:2157.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] 2022-03-13 02:10:58.072 | INFO | main:main:104 - Model Summary: Params: 5.03M, Gflops: 15.15 2022-03-13 02:10:58.224 | INFO | main:main:117 - loading checkpoint Traceback (most recent call last): File "fishing.py", line 223, in main(exp, args) File "fishing.py", line 120, in main model.load_state_dict(ckpt["model"]) File "C:\ProgramData\Anaconda3\envs\ysfish\lib\site-packages\torch\nn\modules\module.py", line 1483, 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([7, 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([7]). 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([7, 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([7]). 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([7, 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([7]).

这是报错代码

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

LittleMio commented 2 years ago

这个报错是因为你使用了作者原来的权重导致的,只要换成我提供的权重就好

liahua commented 2 years ago

这个报错是因为你使用了作者原来的权重导致的,只要换成我提供的权重就好

谢谢.