[Python] Loading a Keras model given an already opened file

Discussão em 'Python' iniciado por Stack, Maio 21, 2025.

  1. Stack

    Stack Membro Participativo

    The common way to load a saved model is with keras.models.load_model method.

    keras.models.load_model("/mypath/model.h5")


    My question is if this can be done giving a file object, something like this:

    file = open("/mypath/model.h5")
    keras.models.load_model(file)


    This code doesn't work, I've searched on internet for this but there has been no luck.

    Continue reading...

Compartilhe esta Página