Closed cuihaoleo closed 5 years ago
@cuihaoleo I check the command you run. The "imgcls.py" builds the model with a default 18-layer resnet but the pre-trained model is a 34-layer resnet. I think that's why some variables are not found in the graph when loading the model from the checkpoint. Can you try to add the "-d34" when you run "imgcls.py"?
Building the model from the graph seems also help :) It is better to follow the same pre-processing of the images with training e.g. resize the shortest edge to 256 and do the center crop with 224x224, which might have better performance.
Hope this help. Let me know if you have further problems.
Thanks for your suggestion!
Does work with -d34
.
Well, I believe the code in this repo is inconsist with the pre-trained model.
I see lots of
Variable XXX in checkpoint not found in the graph
warnings when runningtest/imgcls.py
. Like this (full output):And it seems output labels are not correct. I cannot find a most significant label for photos with the same celeb ID:
I have noticed that you provide a MetaGraph export
graph-0707-065819.meta
in the model zip file. Finally I managed to restore complete graph and write a new predict script (Python3):For the same dataset, this script seems to give correct predictions. 63 of 83 photos are labeled as class 3184: