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

KeyError: Unable to find "net" key in the trained model from detect.py #68

Open
kkarnatak opened this issue Oct 19, 2022 · 0 comments
Open

Comments

@kkarnatak
Copy link

kkarnatak commented Oct 19, 2022

Hi Guys,

I am using this project on conda env with gpu configured. I was trying to just run the inference files first to try it out, but I get the following error:

Traceback (most recent call last):
File "c:\CULane\lanedet\tools\detect.py", line 86, in
process(args)
File "c:\CULane\lanedet\tools\detect.py", line 72, in process
detect = Detect(cfg)
File "c:\CULane\lanedet\tools\detect.py", line 24, in init
load_network(self.net, self.cfg.load_from)
File "c:\culane\lanedet\lanedet\utils\net_utils.py", line 48, in load_network
net.load_state_dict(pretrained_model['net'], strict=True)
KeyError: 'net'

I have used following command:
$ python detect.py' 'lanedet/configs/resa/resa34_culane.py' '--img' 'image\' '--load_from' 'C:\Users\blackbug\.cache\torch\hub\checkpoints\resnet34-333f7ec4.pth' '--savedir' './vis'

I tried to look at the model loaded from the downloaded resnet model file; it looks valid with all the trained layers, just "net" isnt part of the dictionary. Any help is appreciated! Thank you!

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