hnuzhy / fcos_pose

Human Behavior Detection Framework Based on FCOS (Object Detection) and Auxiliary Keypoints (Pose Estimation)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

你好,关于模型尺寸问题

th512 opened this issue · comments

commented

您好, 直接使用FCOS_R_50_FPN_1x.pth(https://cloudstor.aarnet.edu.au/plus/s/dDeDPBLEAt19Xrl/download)模型, 该模型的尺寸并不能直接使用

Traceback (most recent call last):
File "tools/test_net.py", line 97, in
main()
File "tools/test_net.py", line 66, in main
_ = checkpointer.load(cfg.MODEL.WEIGHT)
File "fcos_core/utils/checkpoint.py", line 62, in load
self._load_model(checkpoint)
File "fcos_core/utils/checkpoint.py", line 98, in _load_model
load_state_dict(self.model, checkpoint.pop("model"))
File "fcos_core/utils/model_serialization.py", line 80, in load_state_dict
model.load_state_dict(model_state_dict)
File "/root/anaconda3/envs/fcos/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1223, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for GeneralizedRCNNPose:
size mismatch for rpn.head.cls_logits.weight: copying a param with shape torch.Size([80, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([3, 256, 3, 3]).
size mismatch for rpn.head.cls_logits.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([3]).

请问一下能否提供一下模型?

您好, 直接使用FCOS_R_50_FPN_1x.pth(https://cloudstor.aarnet.edu.au/plus/s/dDeDPBLEAt19Xrl/download)模型%E6%A8%A1%E5%9E%8B), 该模型的尺寸并不能直接使用

Traceback (most recent call last): File "tools/test_net.py", line 97, in main() File "tools/test_net.py", line 66, in main _ = checkpointer.load(cfg.MODEL.WEIGHT) File "fcos_core/utils/checkpoint.py", line 62, in load self._load_model(checkpoint) File "fcos_core/utils/checkpoint.py", line 98, in _load_model load_state_dict(self.model, checkpoint.pop("model")) File "fcos_core/utils/model_serialization.py", line 80, in load_state_dict model.load_state_dict(model_state_dict) File "/root/anaconda3/envs/fcos/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1223, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for GeneralizedRCNNPose: size mismatch for rpn.head.cls_logits.weight: copying a param with shape torch.Size([80, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([3, 256, 3, 3]). size mismatch for rpn.head.cls_logits.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([3]).

请问一下能否提供一下模型?
Note this line size mismatch for rpn.head.cls_logits.weight: copying a param with shape torch.Size([80, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([3, 256, 3, 3]).
The original FCOS model is trained and defined based on the COCO dataset with 80 object categories. However, in my project, the behavior type is changed into 3 (e.g., fight, tumble, and squat). So the original model can not be used directly by the test_net.py script.
For personal privacy security, I am sorry that I can not release the dataset and pre-trained model. Based on the released codes and tutorial, you can build your own similar project.

commented

您好,不能直接使用FCOS_R_50_FPN_1x.pth( https://cloudstor.aarnet.edu.au/plus/s/dDeDPBLEAt19Xrl/download)模型%E6%A8%A1%E5%9E%8B),该模型的尺寸并直接使用
weight:从检查点复制一个形状为 torch.Size([80, 256, 3, 3]) 的参数,当前模型中的形状为 torch.Size([3, 256, 3, 3])。rpn.head.cls_logits.bias 的大小不匹配:从检查点复制形状为 torch.Size([80]) 的参数,当前模型中的形状为 torch.Size([3])。
可以提供一下模型吗?
注意这一行size mismatch for rpn.head.cls_logits.weight: copying a param with shape torch.Size([80, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([3, 256, 3, 3]).
原始的 FCOS 模型是基于 COCO 数据集训练和定义的,包含 80 个对象类别。但是,在我的项目中,行为类型改为3(例如,打架、翻滚和蹲下)。test_net.py所以脚本不能直接使用原始模型。
为了个人隐私安全,很抱歉无法发布数据集和预训练模型。根据发布的代码和教程,您可以构建自己的类似项目。

thank you