Giter Site home page Giter Site logo

Comments (6)

DianaLi96 avatar DianaLi96 commented on July 22, 2024 1

@simonsayshi may be you can see the default classes in models.py ,change the default setting to what do you want, this may cause the model which last layer dimension is 21 in hdf5 file.it may be the reason of the problem.

from keras-fcn.

bgr33r avatar bgr33r commented on July 22, 2024

I solved this. The Problem was with the model: it had 21 classes instead of 2.

from keras-fcn.

simonsayshi avatar simonsayshi commented on July 22, 2024

hi, how do you solve this issue?
I changed the classes in train.py from 21 to 5(my data has 5 classes) and the training works good but when I run evaluate.py(I also changed the nb_classes to 5) this issue occurs:

ValueError: Dimension 0 in both shapes must be equal, but are 1 and 5. Shapes are [1,1,4096,21] and [5,4096,1,1]. for 'Assign_30' (op: 'Assign') with input shapes: [1,1,4096,21], [5,4096,1,1].

this is really annoying since I matched the parameters for train and evaluate but this just keep showing, how did you solve it? thanks!

from keras-fcn.

simonsayshi avatar simonsayshi commented on July 22, 2024

@bgr33r

from keras-fcn.

bgr33r avatar bgr33r commented on July 22, 2024

@simonsayshi I would recommend digging through your code and making sure that the variables relating to class number are set correctly. Also, you should make sure you're loading the correct model file (.hdf5). I "solved" the problem when I realized I had made a mistake with the number of classes denoted in the model (doh!).

from keras-fcn.

simonsayshi avatar simonsayshi commented on July 22, 2024

thanks for reply! but I still want make it clear.
I only changed the classe in train.py and nb_classes in evaluate.py for my dataset
when I use the original number, 21 classes, the train.py and evaluate.py works without any problems
but when I change it to any other number like 4 or 5(for both scripts), the issue occurs

I only have one model file which is generated by train.py so I don't think I loaded wrong model. So what did you do? did you just let the 'classes' in train.py and 'nb_class' in evaluate.py be the same number then everything works? this is what I did but the issue remains! :(

from keras-fcn.

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.