Closed khodabakhshih closed 3 years ago
I think it is about line 91 in file "test2_label.py" network.load_state_dict(state_dict['a'], strict=False) the '.pt' files has 'a' and '.pth' has not. Therefore for '.pth' files we should use: network.load_state_dict(state_dict, strict=False)
another question: what '.yaml' file should be use for '.pth' files? why the cosine distance of feature vectors using '.pth' files are near 1 while it is nice for '.pt' files?
Hi @khodabakhshih I wrote many different structure choices for our model structure.
So we need to load yaml
config files to get the right model structure first.
Then we can load the weight into the model structure.
-- models # contain the teacher models
-- outputs # contain the final DG-Net models
@layumi Thank you very much.
Hi Thanks for your great work. I use the pre-trained model for feature extraction using function “extract_feature” in the file “test2_label.py”. There is no problem with ‘.pt’ models in the “outputs” folder, but when I want to use the ‘net_last.pth’ model in folder “model” I receive the following error: KeyError Traceback (most recent call last)