Open nkbenamara opened 5 years ago
I also met the same problem. After seeing the source code, I found It's no need to write anything after "pretrained_weights" in the configuration JSON File. These weights not reconstructed will be loaded to the reconstructed yolo model (one big feature extractor layer and one small output layer). And the backend layers can be loaded pretrained weights in the file "backend.py" (it has been configed),
for example
# line 11 in the file "backend.py"
FULL_YOLO_BACKEND_PATH = "full_yolo_backend.h5"
TINY_YOLO_BACKEND_PATH = "tiny_yolo_backend.h5"
SQUEEZENET_BACKEND_PATH = "squeezenet_backend.h5"
MOBILENET_BACKEND_PATH = "mobilenet_backend.h5"
INCEPTION3_BACKEND_PATH = "inception_backend.h5"
VGG16_BACKEND_PATH = "vgg16_backend.h5"
RESNET50_BACKEND_PATH = "resnet50_backend.h5"
...
class FullYoloFeature(BaseFeatureExtractor):
...
self.feature_extractor.load_weights(FULL_YOLO_BACKEND_PATH)
I also met the same problem. After seeing the source code, I found It's no need to write anything after "pretrained_weights" in the configuration JSON File. These weights not reconstructed will be loaded to the reconstructed yolo model (one big feature extractor layer and one small output layer). And the backend layers can be loaded pretrained weights in the file "backend.py" (it has been configed),
for example
# line 11 in the file "backend.py" FULL_YOLO_BACKEND_PATH = "full_yolo_backend.h5" TINY_YOLO_BACKEND_PATH = "tiny_yolo_backend.h5" SQUEEZENET_BACKEND_PATH = "squeezenet_backend.h5" MOBILENET_BACKEND_PATH = "mobilenet_backend.h5" INCEPTION3_BACKEND_PATH = "inception_backend.h5" VGG16_BACKEND_PATH = "vgg16_backend.h5" RESNET50_BACKEND_PATH = "resnet50_backend.h5" ... class FullYoloFeature(BaseFeatureExtractor): ... self.feature_extractor.load_weights(FULL_YOLO_BACKEND_PATH)
U r right. Give a 赞 to you.
Hi all.
I'm trying to load pretrained weights of the tiny yolo model, and it writes that the model don't fit to the number of model layers
ValueError: You are trying to load a weight file containing 16 layers into a model with 2 layers.
anyone has before fixed this problem ?
(Construction of the model)
(In the YOLO class (frontend.py))
(backend of TinyYOLO)
My configuration JSON File :