Closed antenna-fast closed 3 years ago
I noticed there is no "world_classifier" in model, but "map_classifier" exist
I fixed it using the code below:
# create a new state_dict [debug] [world->map]
resume_dict = torch.load(resume_fname)
new_state_dict = OrderedDict()
for k, v in resume_dict.items():
if 'world' in k:
new_k = k.replace('world', 'map')
else:
new_k = k
new_state_dict[new_k] = v
model.load_state_dict(new_state_dict)
model.eval()
thanks for the issue and the fix. the problem was due to module renaming at a certain stage.
Help: An error occured to me as shown in below, how to solve it?
Missing key(s) in state_dict: "map_classifier.0.weight", "map_classifier.0.bias", "map_classifier.2.weight", "map_classifier.2.bias", "map_classifier.4.weight".
Unexpected key(s) in state_dict: "world_classifier.0.weight", "world_classifier.0.bias", "world_classifier.2.weight", "world_classifier.2.bias", "world_classifier.4.weight".