rcmalli/keras-vggface

wan to load the pretrained model from local file

Myeong-Yeon opened this issue · 1 comments

Please run this code and share your library versions

import tensorflow as tf
import keras
import keras_vggface

print(tf.__version__)
print(keras.__version__)
print(keras_vggface.__version__)

1.8.0
2.1.2
0.5

Bug reports:
I want to load the pretrained model from local file, not download it on demand
The file is the same file from the url in util.py(RESNET50_WEIGHTS_PATH_NO_TOP = 'https://github.com/rcmalli/keras-vggface/releases/download/v2.0/rcmalli_vggface_tf_notop_resnet50.h5')

But the code below raises a ValueError

my code
VGGFace(model='resnet50',
include_top=False,
input_shape=(224, 224, 3),
weights='path/to/pretrained/rcmalli_vggface_tf_notop_resnet50.h5'
pooling='avg')

error report
File "/keras-vggface/keras_vggface/vggface.py", line 64, in VGGFace
raise ValueError('The weights argument should be either '
ValueError: The weights argument should be either None (random initialization) or vggface(pre-training on VGGFace Datasets).

Code Sample:

Please replace this line with a code sample to replicate the issue.

Hey @Myeong-Yeon, you can try using

VGGFace(model='resnet50',
include_top=False,
input_shape=(224, 224, 3),
weights='resnet50'
pooling='avg')