Skip to content

AttributeError: 'str' object has no attribute 'decode' #179

@LZZ383

Description

@LZZ383

#from keras_vggface.vggface import VGGFace

VGGFace ResNet50

#vggface = VGGFace(include_top=False, model='resnet50', input_shape=(224, 224, 3))'

from colab_demo.vggface_models import RESNET50
vggface = RESNET50(include_top=False, weights=None, input_shape=(224, 224, 3))
vggface.load_weights("rcmalli_vggface_tf_notop_resnet50.h5")

#from keras.applications.resnet50 import ResNet50
#vggface = ResNet50(include_top=False, input_shape=(224, 224, 3))

#vggface.summary()

model.build_pl_model(vggface_model=vggface, before_activ=loss_config["PL_before_activ"])
model.build_train_functions(loss_weights=loss_weights, **loss_config)

Error:

AttributeError Traceback (most recent call last)
in ()
6 from colab_demo.vggface_models import RESNET50
7 vggface = RESNET50(include_top=False, weights=None, input_shape=(224, 224, 3))
----> 8 vggface.load_weights("rcmalli_vggface_tf_notop_resnet50.h5")
9
10 #from keras.applications.resnet50 import ResNet50

1 frames
/usr/local/lib/python3.7/dist-packages/keras/engine/topology.py in load_weights_from_hdf5_group(f, layers, reshape)
3326 """
3327 if 'keras_version' in f.attrs:
-> 3328 original_keras_version = f.attrs['keras_version'].decode('utf8')
3329 else:
3330 original_keras_version = '1'

AttributeError: 'str' object has no attribute 'decode'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions