Giter Club home page Giter Club logo

Comments (7)

HAsarvesh avatar HAsarvesh commented on July 17, 2024 1

Hi @KazuhideMimura , thanks for the reply.
error is fixed, I just gave the value for parameter nb_classes in RotNetDataGenerator class as 4.
But after training the model, while testing I'm not getting the proper output i.e., the images are as it is, they are not rotating.
I'm using custom data and I'm giving the raw images, do I need to manipulate the images before training?

from rotnet.

HAsarvesh avatar HAsarvesh commented on July 17, 2024

HI @KazuhideMimura , I tried to train the model for 4 classes, its giving
ValueError: Error when checking target: expected fc360 to have shape (4,) but got array with shape (360,).
do we need to change any files other than utils.py

from rotnet.

KazuhideMimura avatar KazuhideMimura commented on July 17, 2024

Hi @HAsarvesh , thank you for the repo.
Would you provide me with a detailed error log? I'd like to know where the error occurred.

from rotnet.

KazuhideMimura avatar KazuhideMimura commented on July 17, 2024

You don't need add special treatment to the original image. I think the possibilities are:

  1. Training did not go well
  2. nb_classes is not designated

For example, if you run a function display example...

display_examples(
    model, 
    test_filenames,
    num_images=num_images,
    size=(224, 224),
    crop_center=True,
    crop_largest_rect=True,
    preprocess_func=preprocess_input,
    nb_classes=4, # designate nb_class
)

Please note that nb_class will be set at 360 unless designated. This is because I didn't want to disturb the original concept.

from rotnet.

HAsarvesh avatar HAsarvesh commented on July 17, 2024

Thanks for the clarification, I'll train it again and check.

from rotnet.

KazuhideMimura avatar KazuhideMimura commented on July 17, 2024

Here?

predictions = model.predict_generator(

    predictions = model.predict_generator(
        RotNetDataGenerator(
            image_paths,
            input_shape=(224, 224, 3),
            batch_size=64,
            one_hot=True,
            preprocess_func=preprocess_input,
            rotate=False,
            crop_largest_rect=True,
            crop_center=True,
            nb_classes = model.layers[-1].units, # added. Not sure it works, but statement is required to obtain model's class number.
        ),
        val_samples=len(image_paths)
    )

from rotnet.

HAsarvesh avatar HAsarvesh commented on July 17, 2024

Thanks @KazuhideMimura, I'll try this.

from rotnet.

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.