I tried to run test_frcnn.py with pre-trained model_frcnn.hdf5 but I met this error:
Loading weights from ./model_frcnn.hdf5
Traceback (most recent call last):
File "/content/BCCD_Dataset/keras-frcnn/test_frcnn.py", line 136, in
model_rpn.load_weights("/content/BCCD_Dataset/model_frcnn.hdf5")
File "/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py", line 458, in load_wrapper
return load_function(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/network.py", line 1217, in load_weights
f, self.layers, reshape=reshape)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py", line 1171, in load_weights_from_hdf5_group
str(len(filtered_layers)) + ' layers.')
ValueError: You are trying to load a weight file containing 111 layers into a model with 89 layers.
The question is: Why we save weights of model_all (a model that holds both the RPN and the classifier) then load weights for model_rpn and model_classifier separately? Is this method causing the error?
I tried to run test_frcnn.py with pre-trained model_frcnn.hdf5 but I met this error:
Loading weights from ./model_frcnn.hdf5 Traceback (most recent call last): File "/content/BCCD_Dataset/keras-frcnn/test_frcnn.py", line 136, in
model_rpn.load_weights("/content/BCCD_Dataset/model_frcnn.hdf5")
File "/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py", line 458, in load_wrapper
return load_function(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/network.py", line 1217, in load_weights
f, self.layers, reshape=reshape)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py", line 1171, in load_weights_from_hdf5_group
str(len(filtered_layers)) + ' layers.')
ValueError: You are trying to load a weight file containing 111 layers into a model with 89 layers.
The question is: Why we save weights of model_all (a model that holds both the RPN and the classifier) then load weights for model_rpn and model_classifier separately? Is this method causing the error?