Skip to content

Issue with Ch.7 Code, plus a fix for a problem someone else had #10

Description

@bigearsjonny

siamese_nn.py line 28 gave an error of mismatched types, I changed the line to this to fix it:
model.fit([np.float32(training_pairs[:, 0]), np.float32(training_pairs[:, 1])], np.float32(training_labels), batch_size=128, epochs=10)

Now, when I try to run face_recognition_system.py, I get a "SystemError: unknown opcode" message on line 25.

The Keras documentation says we need to supply a custom_objects paramter, and it is supplied, but obviously not correctly.
model = load_model('siamese_nn.h5', custom_objects={'contrastive_loss': utils.contrastive_loss, 'euclidean_distance': utils.euclidean_distance})

Please help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions