Giter VIP home page Giter VIP logo

Comments (8)

kkawtar avatar kkawtar commented on July 29, 2024

did you found a solution for that ?

from keras-fasterrcnn.

hodaatef avatar hodaatef commented on July 29, 2024

any one solved this error please???

from keras-fasterrcnn.

attilab97 avatar attilab97 commented on July 29, 2024

if len(neg_samples) != 0:
try:
selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples), replace=False).tolist()
except:
selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples), replace=True).tolist()
Just put a test before selecting negative samples.

from keras-fasterrcnn.

gdut3118007086 avatar gdut3118007086 commented on July 29, 2024

if len(neg_samples) != 0:
try:
selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples), replace=False).tolist()
except:
selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples), replace=True).tolist()
Just put a test before selecting negative samples.

after that i meet another question

File "train_frcnn.py", line 275, in
loss_class = model_classifier.train_on_batch([X, X2[:, sel_samples, :]], [Y1[:, sel_samples, :], Y2[:, sel_samples, :]])
IndexError: index 4 is out of bounds for axis 1 with size 1

from keras-fasterrcnn.

gdut3118007086 avatar gdut3118007086 commented on July 29, 2024

(any one solved this error please???)

from keras-fasterrcnn.

AdamJochna avatar AdamJochna commented on July 29, 2024
    if C.num_rois > 1:
        if len(pos_samples) < C.num_rois//2:
            selected_pos_samples = pos_samples.tolist()
        else:
            if len(pos_samples) > 0:
                selected_pos_samples = np.random.choice(pos_samples, C.num_rois//2, replace=False).tolist()
            else:
                selected_pos_samples = []
        try:
            if len(neg_samples) > 0:
                selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples), replace=False).tolist()
            else:
                selected_neg_samples = []
        except:
            if len(neg_samples) > 0:
                selected_neg_samples = np.random.choice(neg_samples, C.num_rois - len(selected_pos_samples), replace=True).tolist()
            else:
                selected_neg_samples = []

        sel_samples = selected_pos_samples + selected_neg_samples
    else:

from keras-fasterrcnn.

AdamJochna avatar AdamJochna commented on July 29, 2024

that seems to solve this issue

from keras-fasterrcnn.

Try2ChangeX avatar Try2ChangeX commented on July 29, 2024

I also met this problem. Anyone solve that? Help...

from keras-fasterrcnn.

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.