soap117 / DeepRule

BSD 3-Clause "New" or "Revised" License
129 stars 45 forks source link

Failed to load state_dict about clsdata #14

Open guxiahui opened 2 years ago

guxiahui commented 2 years ago

Hi guys, I tried to run DeepRule as server with "python manage.py runserver 8800".

And exception has been thrown out during load model from data/clsdata(1031)/cache/nnet/CornerNetCls/CornerNetCls_50000.pkl.

The model file is from the link in readme file. Seems some updates in the code do not match the linked model file.

loading model from data/clsdata(1031)/cache/nnet/CornerNetCls/CornerNetCls_50000.pkl Exception in thread django-main-thread: Traceback (most recent call last): File "/root/anaconda3/envs/DeepRule/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/root/anaconda3/envs/DeepRule/lib/python3.6/threading.py", line 864, in run self._target(*self._args, *self._kwargs) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/utils/autoreload.py", line 54, in wrapper fn(args, kwargs) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run self.check(display_num_errors=True) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/core/management/base.py", line 390, in check include_deployment_checks=include_deployment_checks, File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/core/management/base.py", line 377, in _run_checks return checks.run_checks(kwargs) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/core/checks/registry.py", line 72, in run_checks new_errors = check(app_configs=app_configs) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces url_patterns = getattr(resolver, 'url_patterns', []) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/utils/functional.py", line 80, in get res = instance.dict[self.name] = self.func(instance) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/urls/resolvers.py", line 584, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/utils/functional.py", line 80, in get res = instance.dict[self.name] = self.func(instance) File "/root/anaconda3/envs/DeepRule/lib/python3.6/site-packages/django/urls/resolvers.py", line 577, in urlconf_module return import_module(self.urlconf_name) File "/root/anaconda3/envs/DeepRule/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/guxiahui/workspace/DeepRule/server_match/urls.py", line 17, in from . import view File "/home/guxiahui/workspace/DeepRule/server_match/view.py", line 2, in from test_pipeline import test File "/home/guxiahui/workspace/DeepRule/test_pipeline.py", line 120, in methods = Pre_load_nets() File "/home/guxiahui/workspace/DeepRule/test_pipeline.py", line 92, in Pre_load_nets "data/clsdata(1031)/result") File "/home/guxiahui/workspace/DeepRule/test_pipeline.py", line 83, in load_net nnet.load_params(test_iter) File "/home/guxiahui/workspace/DeepRule/nnet/py_factory.py", line 122, in load_params self.model.load_state_dict(params) File "/root/anaconda3/envs/DeepRule/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_tracked", "module.kps.0.up1.1.bn1.num_batches_tracked", "module.kps.0.up1.1.bn2.num_batches_tracked", "module.kps.0.low1.0.bn1.num_batches_tracked", "module.kps.0.low1.0.bn2.num_batches_tracked", "module.kps.0.low1.0.skip.1.num_batches_tracked", "module.kps.0.low1.1.bn1.num_batches_tracked", "module.kps.0.low1.1.bn2.num_batches_tracked", "module.kps.0.low2.up1.0.bn1.num_batches_tracked", "module.kps.0.low2.up1.0.bn2.num_batches_tracked", "module.kps.0.low2.up1.1.bn1.num_batches_tracked", "module.kps.0.low2.up1.1.bn2.num_batches_tracked", "module.kps.0.low2.low1.0.bn1.num_batches_tracked", "module.kps.0.low2.low1.0.bn2.num_batches_tracked", "module.kps.0.low2.low1.0.skip.1.num_batches_tracked", "module.kps.0.low2.low1.1.bn1.num_batches_tracked", "module.kps.0.low2.low1.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.up1.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.up1.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.up1.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.up1.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low1.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low1.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low1.0.skip.1.num_batches_tracked", "module.kps.0.low2.low2.low1.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low1.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.up1.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.up1.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.up1.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.up1.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low1.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low1.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low1.0.skip.1.num_batches_tracked", "module.kps.0.low2.low2.low2.low1.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low1.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.up1.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.up1.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.up1.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.up1.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low1.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low1.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low1.0.skip.1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low1.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low1.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low2.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low2.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low2.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low2.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low2.2.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low2.2.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low2.3.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low2.3.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low3.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low3.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low3.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low3.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low2.low3.1.skip.1.num_batches_tracked", "module.kps.0.low2.low2.low2.low3.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low3.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low2.low3.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low2.low3.1.bn2.num_batches_tracked", "module.kps.0.low2.low2.low3.0.bn1.num_batches_tracked", "module.kps.0.low2.low2.low3.0.bn2.num_batches_tracked", "module.kps.0.low2.low2.low3.1.bn1.num_batches_tracked", "module.kps.0.low2.low2.low3.1.bn2.num_batches_tracked", "module.kps.0.low2.low3.0.bn1.num_batches_tracked", "module.kps.0.low2.low3.0.bn2.num_batches_tracked", "module.kps.0.low2.low3.1.bn1.num_batches_tracked", "module.kps.0.low2.low3.1.bn2.num_batches_tracked", "module.kps.0.low2.low3.1.skip.1.num_batches_tracked", "module.kps.0.low3.0.bn1.num_batches_tracked", "module.kps.0.low3.0.bn2.num_batches_tracked", "module.kps.0.low3.1.bn1.num_batches_tracked", "module.kps.0.low3.1.bn2.num_batches_tracked", "module.kps.1.up1.0.bn1.num_batches_tracked", "module.kps.1.up1.0.bn2.num_batches_tracked", "module.kps.1.up1.1.bn1.num_batches_tracked", "module.kps.1.up1.1.bn2.num_batches_tracked", "module.kps.1.low1.0.bn1.num_batches_tracked", "module.kps.1.low1.0.bn2.num_batches_tracked", "module.kps.1.low1.0.skip.1.num_batches_tracked", "module.kps.1.low1.1.bn1.num_batches_tracked", "module.kps.1.low1.1.bn2.num_batches_tracked", "module.kps.1.low2.up1.0.bn1.num_batches_tracked", "module.kps.1.low2.up1.0.bn2.num_batches_tracked", "module.kps.1.low2.up1.1.bn1.num_batches_tracked", "module.kps.1.low2.up1.1.bn2.num_batches_tracked", "module.kps.1.low2.low1.0.bn1.num_batches_tracked", "module.kps.1.low2.low1.0.bn2.num_batches_tracked", "module.kps.1.low2.low1.0.skip.1.num_batches_tracked", "module.kps.1.low2.low1.1.bn1.num_batches_tracked", "module.kps.1.low2.low1.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.up1.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.up1.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.up1.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.up1.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low1.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low1.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low1.0.skip.1.num_batches_tracked", "module.kps.1.low2.low2.low1.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low1.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.up1.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.up1.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.up1.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.up1.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low1.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low1.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low1.0.skip.1.num_batches_tracked", "module.kps.1.low2.low2.low2.low1.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low1.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.up1.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.up1.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.up1.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.up1.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low1.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low1.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low1.0.skip.1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low1.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low1.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low2.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low2.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low2.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low2.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low2.2.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low2.2.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low2.3.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low2.3.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low3.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low3.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low3.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low3.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low2.low3.1.skip.1.num_batches_tracked", "module.kps.1.low2.low2.low2.low3.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low3.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low2.low3.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low2.low3.1.bn2.num_batches_tracked", "module.kps.1.low2.low2.low3.0.bn1.num_batches_tracked", "module.kps.1.low2.low2.low3.0.bn2.num_batches_tracked", "module.kps.1.low2.low2.low3.1.bn1.num_batches_tracked", "module.kps.1.low2.low2.low3.1.bn2.num_batches_tracked", "module.kps.1.low2.low3.0.bn1.num_batches_tracked", "module.kps.1.low2.low3.0.bn2.num_batches_tracked", "module.kps.1.low2.low3.1.bn1.num_batches_tracked", "module.kps.1.low2.low3.1.bn2.num_batches_tracked", "module.kps.1.low2.low3.1.skip.1.num_batches_tracked", "module.kps.1.low3.0.bn1.num_batches_tracked", "module.kps.1.low3.0.bn2.num_batches_tracked", "module.kps.1.low3.1.bn1.num_batches_tracked", "module.kps.1.low3.1.bn2.num_batches_tracked", "module.cnvs.0.bn.num_batches_tracked", "module.cnvs.1.bn.num_batches_tracked", "module.tl_cnvs.0.p1_conv1.bn.num_batches_tracked", "module.tl_cnvs.0.p2_conv1.bn.num_batches_tracked", "module.tl_cnvs.0.p_bn1.num_batches_tracked", "module.tl_cnvs.0.bn1.num_batches_tracked", "module.tl_cnvs.0.conv2.bn.num_batches_tracked", "module.tl_cnvs.1.p1_conv1.bn.num_batches_tracked", "module.tl_cnvs.1.p2_conv1.bn.num_batches_tracked", "module.tl_cnvs.1.p_bn1.num_batches_tracked", "module.tl_cnvs.1.bn1.num_batches_tracked", "module.tl_cnvs.1.conv2.bn.num_batches_tracked", "module.br_cnvs.0.p1_conv1.bn.num_batches_tracked", "module.br_cnvs.0.p2_conv1.bn.num_batches_tracked", "module.br_cnvs.0.p_bn1.num_batches_tracked", "module.br_cnvs.0.bn1.num_batches_tracked", "module.br_cnvs.0.conv2.bn.num_batches_tracked", "module.br_cnvs.1.p1_conv1.bn.num_batches_tracked", "module.br_cnvs.1.p2_conv1.bn.num_batches_tracked", "module.br_cnvs.1.p_bn1.num_batches_tracked", "module.br_cnvs.1.bn1.num_batches_tracked", "module.br_cnvs.1.conv2.bn.num_batches_tracked", "module.inters.0.bn1.num_batches_tracked", "module.inters.0.bn2.num_batchestracked", "module.inters.0.1.num_batchestracked", "module.cnvs.0.1.num_batches_tracked", "module.cls.bn1.num_batches_tracked", "module.cls.bn2.num_batches_tracked", "module.cls.final.bn.num_batches_tracked", "module.offset.bn1.num_batches_tracked", "module.offset.bn2.num_batches_tracked", "module.offset.final.bn.num_batches_tracked".