Closed MINZLATAN closed 3 years ago
Hello @Min12212121212 , where are you trying to load the state_dict? Are you using the 'continue_exp' in train.py or did you make your own script to load it. Also, can you share a picture of the full error showing which keys are causing the problem.
yes, I made my own script using your pretrained model (8HG) to show the pose estimation of single images.... something like this...
so i tried to load your pretrained model but there was an error occurred.
I think this is a simple issues. but i'm not familiar with using pytorch codes yet. so I can't find the solutions.....:(( anyway thank u so much and hope i can solve this problems asap....:)
and I have one more question, i implemented your 'test.py'. but i got the results like this....
I think this is the reason due to I didn't load your pretrained model(8HG) before I implement this 'test.py' ?! so If i want to see the PCK 0.5 results of your pretrained model. where should i load your pretrained model on your 'test.py' script or any other ways? cuz i couldn't find the right places for load your pretrained model on your 'test.py' script to see the PCK 0.5 results.
Thank you in advance....:))))
You can use a script like this to load weights:
my_model_state_dict = model.state_dict()
count = 0
pretrained_weights = torch.load('checkpoint.pt' )
pretrained_weights_items = list(pretrained_weights.items())
for key,value in my_model_state_dict.items():
layer_name, weights = pretrained_weights_items[count]
my_model_state_dict[key] = weights
print(count)
print(layer_name)
count += 1
model.load_state_dict(my_model_state_dict)
If you load stact_dict inside reload() function of train.py, then it works directly.
You can simply add an argument while running test.py to load a model.
python test.py -c pretrained_model
Here the pretrained_model folder should contain the checkpoint.pt file
Thanks for your answers and I tried to implement your 'train.py' and it is showed like this.... I think it is working....but is that an error which is shown as a '0%| | blah blah ~~' before the 'start train pose' and ' start valid pose' ?? I can see the checkpoint is saved after every epoch is ended. and I can find the checkpoint file too. But not sure I'm doing right way or the problem is happening.
Thank u so much.
I am not sure why this is happening, maybe the authors of the repo can help.
Did you calculate the PCKh score of your custom trained model? If yes, what score are you getting?
not yet, cuz I don't finish the training yet. Just want to know can I ignore that words and keep training my model or not....
Thank u so much always...:)))
no problem. Do close the issue if your issue is solved
Thanks for your useful answers, so far...:))) But can you give me some advices for this? I want to load the pretrained model which is linked in this repo and visualizing the heatmaps and pose estimation of single images. like this...
and I tried the script that you mentioned but still can't sure what is the right way to define the model.
can you give me some advices for this or do you have any demo files which I can visualizing the heatmaps and pose estimations of single images using this pretrained model??
Thank you so much always....:))))
I did not understand what you meant by defining the model?
Simply, like do you know how to visualize the heatmaps and pose estimation of single images from this repo with using the pretrained model ??
Thank u so much....:))))
Were you able to make a script for visualization @MINZLATAN ?
closing for inactivity
when I try to load your pretrain model, there is an error it is saying, 'Missing key(s) in state_dict : ......'
Do you know the solutions?
Thanks