GithubHelp home page GithubHelp logo

Comments (8)

Arsey avatar Arsey commented on September 15, 2024

ValueError: Input arrays should have the same number of samples as target arrays. Found 6149 input samples and 8660 target samples. - It's possible that your data structure has changed since save_bottleneck_features() was completed

from keras-transfer-learning-for-oxford102.

TriLoo avatar TriLoo commented on September 15, 2024

Maybe I know the reason causing this error.
In bottlenecks.py, the way to get training labels is :
train_labels += [k] * len(os.listdir('{}/{}'.format(config.train_dir, i)))
So, if there are other not image files in train dir, this sentense would treat them as images leading to wrong target samples...
In fact, I just used these dataset in SIFT + SVM frame, so there are some .sift files in train data dir. Now, I have deleted them and try again...

from keras-transfer-learning-for-oxford102.

Arsey avatar Arsey commented on September 15, 2024

@TriLoo I've just fixed the issue

from keras-transfer-learning-for-oxford102.

vasudhabansal1994 avatar vasudhabansal1994 commented on September 15, 2024

@Arsey Can you please tell me how did you fix the issue.

from keras-transfer-learning-for-oxford102.

stobasa avatar stobasa commented on September 15, 2024

this is unfair, tell us how you fixed it so we could lesrn

from keras-transfer-learning-for-oxford102.

Arsey avatar Arsey commented on September 15, 2024

@stobasa basically the bottlenecks extraction step is not necessary and do not exist in the code anymore. Please read the code to get the idea. But simply the steps are:

  1. get pretrained model without the last fully-connected layer + its weights
  2. add a fully-connected layer for classification with a number of neurons that is equal to the number of classes you have
  3. freeze N layers of the original pretrained model
  4. start training with small learning rate

all these steps are already implemented

from keras-transfer-learning-for-oxford102.

stobasa avatar stobasa commented on September 15, 2024

@Arsey can you please post the code here..i have been stucked on this for a whole day..this would help me greatly

from keras-transfer-learning-for-oxford102.

Arsey avatar Arsey commented on September 15, 2024

@stobasa code for what?

from keras-transfer-learning-for-oxford102.

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.