Skip to content

NotImplementedException while trying to load VGG19 #1013

Closed

Description

@individ2016

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

Activity

  1. SanftMonster commented on Mar 30, 2023

    @SanftMonster
    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 :)

  2. individ2016 commented on Apr 2, 2023

    @individ2016
    Author

    I will be here waiting) Thank you!

  3. SanftMonster commented on Apr 20, 2023

    @SanftMonster
    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);
  4. individ2016 commented on Jul 27, 2023

    @individ2016
    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

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