Coder Social home page Coder Social logo

ValueError: You are trying to load a weight file containing 16 layers into a model with 19 layers. about image-segmentation-keras HOT 5 CLOSED

divamgupta avatar divamgupta commented on July 20, 2024
ValueError: You are trying to load a weight file containing 16 layers into a model with 19 layers.

from image-segmentation-keras.

Comments (5)

sleach3 avatar sleach3 commented on July 20, 2024 1

I believe I have found the error. if you move the load_weights command down to the below the last Model() call the error goes away

from image-segmentation-keras.

Miranda1994 avatar Miranda1994 commented on July 20, 2024

you can change the " m.load_weights( "/home/miranda/competition_OPPO/image-segmentation-keras/vgg16_weights_th_dim_ordering_th_kernels.h5") " to " m.load_weights( "/home/miranda/competition_OPPO/image-segmentation-keras/vgg16_weights_th_dim_ordering_th_kernels.h5" ,by_name=True ) "

from image-segmentation-keras.

sleach3 avatar sleach3 commented on July 20, 2024

@Miranda1994 I don't believe that solves the issue of loading in weights after you have trained the network and saved out the weights.

from image-segmentation-keras.

appleandhero avatar appleandhero commented on July 20, 2024

vgg16_weights_th_dim_ordering_th_kernels.h5 is 19 layers,but vgg16_weights_th_dim_ordering_th_kernels_notop.h5 is 16 layers

from image-segmentation-keras.

divamgupta avatar divamgupta commented on July 20, 2024

Image segmentation keras has been updated. The new version should fix the issue.

from image-segmentation-keras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.