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

test model error #43

Open
yja1 opened this issue May 29, 2019 · 5 comments
Open

test model error #43

yja1 opened this issue May 29, 2019 · 5 comments

Comments

@yja1
Copy link

yja1 commented May 29, 2019

run python test.py CenterNet-104 --testiter 480000 --split validation
error msg:
loading parameters at iteration: 480000
building neural network...
module_file: models.CenterNet-104
total parameters: 210062960
loading parameters...
loading model from cache/nnet/CenterNet-104/CenterNet-104_480000.pkl
Traceback (most recent call last):
File "test.py", line 99, in
test(testing_db, args.split, args.testiter, args.debug, args.suffix)
File "test.py", line 54, in test
nnet.load_params(test_iter)
File "/CenterNet-keypoint/nnet/py_factory.py", line 132, in load_params
self.model.load_state_dict(params)
File "/env_pyt0.4.0_py3.6_centernet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 721, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DummyModule:
Unexpected key(s) in state_dict: "module.pre.0.bn.num_batches_tracked", "module.pre.1.bn1.num_batches_tracked", "module.pre.1.bn2.num_batches_tracked", "module.pre.1.skip.1.num_batches_tracked", "module.kps.0.up1.0.bn1.num_batches_tracked", "module.kps.0.up1.0.bn2.num_batches_tracke

@yja1
Copy link
Author

yja1 commented May 29, 2019

I have try change but also has error
def load_params(self, iteration):
cache_file = system_configs.snapshot_file.format(iteration)
print("loading model from {}".format(cache_file))
with open(cache_file, "rb") as f:
from collections import OrderedDict
new_state_dict = OrderedDict()
params = torch.load(f)
for k, v in params.items():
head = k[:7]
if head == 'module.':
name = k[7:] # remove module.
else:
name = k
new_state_dict[name] = v

        self.model.load_state_dict(new_state_dict)

@yja1 yja1 closed this as completed May 29, 2019
@yja1 yja1 reopened this May 29, 2019
@yja1 yja1 changed the title test error load model test model error May 29, 2019
@yja1
Copy link
Author

yja1 commented May 29, 2019

dets, center = decode_func(nnet, images, K, ae_threshold=ae_threshold, kernel=nms_kernel)
run here, Segmentation fault (core dumped)
???

@Duankaiwen
Copy link
Owner

@yja1 Can I see your full log?

@yja1
Copy link
Author

yja1 commented May 30, 2019

err.txt
@Duankaiwen

@Duankaiwen
Copy link
Owner

@yja1 the gcc version should be 4.9

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