Skip to content

Saving the model? #7

@FrancPS

Description

@FrancPS

Is it possible to save the model? What library/function can we use to do so?

I have tried all the following, just after plotting the results, and all give me some kind of error...

    ... 
    # Plot resulting membership functions
        fis.plotmfs(sess)
        plt.show()

    #joblib.dump(fis, "./Models/anfisModel")
    #tf.keras.models.save_model(fis, "./Models/anfisModel")
    #fis.save("./Models/anfisModel")
    
    #import pickle
    #pickle.dump(fis, open("./Models/anfisModel", 'wb'))

    tf.saved_model.save(fis, "./Models/anfisModel")

The last one, for example, returns with the following error:

ValueError: Expected a Trackable object for export, got <anfis.ANFIS object at 0x7f592a99daf0>.

All the others return similar errors like "fis has no save atribute" and so on.
I guess it is because it is not a tensorflow object, but a custom one you create using tf?

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