Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster RCNN model that you provide does not work when we load it in for testing? Any idea #1

Open
Haiduri98 opened this issue Oct 7, 2023 · 1 comment

Comments

@Haiduri98
Copy link

/home/hinux/anaconda3/bin/conda run -n 38 --no-capture-output python /home/hinux/pythonProject/surveilling-surveillance/detection/main.py
Skip loading parameter 'roi_heads.box_predictor.cls_score.weight' to the model due to incompatible shapes: (81, 1024) in the checkpoint but (3, 1024) in the model! You might want to double check if this is expected.
Skip loading parameter 'roi_heads.box_predictor.cls_score.bias' to the model due to incompatible shapes: (81,) in the checkpoint but (3,) in the model! You might want to double check if this is expected.
Skip loading parameter 'roi_heads.box_predictor.bbox_pred.weight' to the model due to incompatible shapes: (320, 1024) in the checkpoint but (8, 1024) in the model! You might want to double check if this is expected.
Skip loading parameter 'roi_heads.box_predictor.bbox_pred.bias' to the model due to incompatible shapes: (320,) in the checkpoint but (8,) in the model! You might want to double check if this is expected.
Some model parameters or buffers are not found in the checkpoint:
roi_heads.box_predictor.bbox_pred.{bias, weight}
roi_heads.box_predictor.cls_score.{bias, weight}
Traceback (most recent call last):
File "/home/hinux/pythonProject/surveilling-surveillance/detection/main.py", line 117, in
test(ckpt_path="../data/best.ckpt")
File "/home/hinux/pythonProject/surveilling-surveillance/detection/main.py", line 100, in test
task = load_task(ckpt_path="../data/best.ckpt",
File "/home/hinux/pythonProject/surveilling-surveillance/detection/lightning/init.py", line 13, in load_task
return DetectionTask.load_from_checkpoint(ckpt_path, **kwargs)
File "/home/hinux/anaconda3/envs/38/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 158, in load_from_checkpoint
model = cls._load_model_state(checkpoint, strict=strict, **kwargs)
File "/home/hinux/anaconda3/envs/38/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 204, in _load_model_state
model.load_state_dict(checkpoint['state_dict'], strict=strict)
File "/home/hinux/anaconda3/envs/38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for DetectionTask:
Unexpected key(s) in state_dict: "model.model.proposal_generator.anchor_generator.cell_anchors.0", "model.model.proposal_generator.anchor_generator.cell_anchors.1", "model.model.proposal_generator.anchor_generator.cell_anchors.2", "model.model.proposal_generator.anchor_generator.cell_anchors.3", "model.model.proposal_generator.anchor_generator.cell_anchors.4".
ERROR conda.cli.main_run:execute(49): conda run python /home/hinux/pythonProject/surveilling-surveillance/detection/main.py failed. (See above for error)

Process finished with exit code 1

@Haiduri98
Copy link
Author

Haiduri98 commented Oct 13, 2023

I found out that we need to use Detectron2 version 0.4 - which is not given in the requirements
Pytorch Lightning 1.1.4
(13-10-2023)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant