Skip to content

quick test for load pretrainmodel and mismatch model  #8

Description

@macqueen09

I want to see this model inference. so I use

python test.py \
    --dataset_root ../  \
    --trained_model scanssd/weights/AMATH512_e1GTDB.pth   \
    --test_data testing_data   \
    --model_type 512  \
    --cfg math_gtdb_512  \

AMATH512_e1GTDB.pth is download by your link.
and I get mismatch when load model

8440 - 10-Aug-20 17:19:45 - Exception occurred
Traceback (most recent call last):
  File "test.py", line 194, in <module>
    test_gtdb(args)
  File "test.py", line 111, in test_gtdb
    net.load_state_dict(torch.load(args.trained_model, map_location={'cuda:1':'cuda:0'}))
  File "/mnt/data/anaconda3/envs/alphapose/lib/python3.6/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 DataParallel:
	size mismatch for module.loc.0.weight: copying a param with shape torch.Size([28, 512, 1, 5]) from checkpoint, the shape in current model is torch.Size([48, 512, 1, 1]).
	size mismatch for module.loc.0.bias: copying a param with shape torch.Size([28]) from checkpoint, the shape in current model is torch.Size([48]).
	size mismatch for module.loc.1.weight: copying a param with shape torch.Size([28, 1024, 1, 5]) from checkpoint, the shape in current model is torch.Size([48, 1024, 1, 1]).
	size mismatch for module.loc.1.bias: copying a param with shape torch.Size([28]) from checkpoint, the shape in current model is torch.Size([48]).
	size mismatch for module.loc.2.weight: copying a param with shape torch.Size([28, 512, 1, 5]) from checkpoint, the shape in current model is torch.Size([48, 512, 1, 1]).
	size mismatch for module.loc.2.bias: copying a param with shape torch.Size([28]) from checkpoint, the shape in current model is torch.Size([48]).
...
many mismatch.....
...
8440 - 10-Aug-20 17:19:45 - Toal time taken 0:00:02.656999
8440 - 10-Aug-20 17:19:45 - Testing done!

what can i do for watch a demo by this model.
Thank you very much.

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