Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NotImplementedException while trying to load VGG19 #1013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
individ2016 opened this issue Mar 26, 2023 · 4 comments · Fixed by #1027
Closed

NotImplementedException while trying to load VGG19 #1013

individ2016 opened this issue Mar 26, 2023 · 4 comments · Fixed by #1027

Comments

@individ2016
Copy link

individ2016 commented Mar 26, 2023

I'm trying to load VGG19 model from https://huggingface.co/keras-io/VGG19 and get NotImplementedException in method Tensorflow.Keras.Saving.KerasObjectLoader._infer_inputs(int layer_node_id, bool convert_to_shapes = false)

help please)

code is simple:

var model = keras.models.load_model("./vgg19");
model.summary();

P.S. if it is important - im using SciSharp.TensorFlow.Redist-Windows-GPU package

@AsakusaRinne
Copy link
Collaborator

Hi, sorry for the late response. The support of loading model in v0.100.4 is not complete. I was developing it rapidly recently. I'll tell you once I finish it :)

@individ2016
Copy link
Author

I will be here waiting) Thank you!

@AsakusaRinne
Copy link
Collaborator

The loading of VGG19 has been fixed. Now it works with the model in the link.

The following is an example:

        var model = tf.keras.models.load_model(@"model path");
        model.summary();

        var classify_model = keras.Sequential(new System.Collections.Generic.List<Tensorflow.Keras.ILayer>()
        {
            model,
            keras.layers.Flatten(),
            keras.layers.Dense(10),
        });
        classify_model.summary();

        classify_model.compile(tf.keras.optimizers.Adam(), tf.keras.losses.SparseCategoricalCrossentropy(), new string[] { "accuracy" });

        var x = np.random.uniform(0, 1, (8, 512, 512, 3));
        var y = np.ones((8));

        classify_model.fit(x, y, batch_size: 4);

@individ2016
Copy link
Author

thank you a lot) will try it soon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants