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

I want use custom dataset #19

Closed
HansolEom opened this issue Feb 5, 2020 · 4 comments
Closed

I want use custom dataset #19

HansolEom opened this issue Feb 5, 2020 · 4 comments

Comments

@HansolEom
Copy link

How can I learn from my dataset?

@sfzhang15
Copy link
Owner

@HansolEom
You can refer to this. If you have any questions, please feel free to contact us.

@HansolEom
Copy link
Author

@HansolEom
You can refer to this. If you have any questions, please feel free to contact us.

Thank you for your reply.

@HansolEom
Copy link
Author

HansolEom commented Feb 13, 2020

@HansolEom
You can refer to this. If you have any questions, please feel free to contact us.

Thank you for your reply.

Traceback (most recent call last):
File "tools/train_net.py", line 183, in
main()
File "tools/train_net.py", line 179, in main
model = train(cfg, args.local_rank, args.distributed)
File "tools/train_net.py", line 59, in train
extra_checkpoint_data = checkpointer.load(cfg.MODEL.WEIGHT)
File "/workspace/ATSS/atss_core/utils/checkpoint.py", line 63, in load
self._load_model(checkpoint)
File "/workspace/ATSS/atss_core/utils/checkpoint.py", line 99, in _load_model
load_state_dict(self.model, checkpoint.pop("model"))
File "/workspace/ATSS/atss_core/utils/model_serialization.py", line 82, in load_state_dict
model.load_state_dict(model_state_dict)
File "/opt/conda/envs/ATSS/lib/python3.7/site-packages/torch/nn/modules/module.py", line 777, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DistributedDataParallel:
size mismatch for module.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([23, 256, 3, 3]).
size mismatch for module.rpn.head.cls_logits.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([23]).

I haven't solved this problem.
I want to learn about 23 classes. But I think I got an error loading 80 models already learned. I want to use pretraine resnet. Is there a way?

@sfzhang15
Copy link
Owner

@HansolEom
If your 23 classes is the subset of COCO 80 classes, you can chose the 23 channels from the 80 channels of the classification prediction layer and save this model to use. If not, you can drop the weights of the classification prediction layer and save it to use as pretrain.

@sfzhang15 sfzhang15 reopened this Feb 13, 2020
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

2 participants