Skip to content

Error in loading resnet model #25

@sparshgarg23

Description

@sparshgarg23

I am using model_zoo.load_url to load resnet50 model,however when I use the downloaded model,I end up recieivng the error message as shown below

loading annotations into memory...
Done (t=18.10s)
creating index...
index created!
INFO====>check annos, filtering invalid data......
Traceback (most recent call last):
  File "train_coco.py", line 39, in <module>
    model=FCOSDetector(mode="training").cuda()
  File "/content/fcos/model/fcos.py", line 217, in __init__
    self.fcos_body=FCOS(config=config)
  File "/content/fcos/model/fcos.py", line 22, in __init__
    self.backbone=resnet34(pretrained=True,if_include_top=False)
  File "/content/fcos/model/backbone/resnet.py", line 194, in resnet34
    model.load_state_dict(model_zoo.load_url(model_urls['resnet34']))
  File "/usr/local/lib/python3.7/dist-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 ResNet:
	Unexpected key(s) in state_dict: "fc.weight", "fc.bias"

Would it be possible for you to share the resnet50.pth file,if not then any suggestions on what can be done to resolve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions