Giter VIP home page Giter VIP logo

Comments (9)

abhimanyudubey avatar abhimanyudubey commented on July 20, 2024

Hey,

Can you try lowering the value of lambda? Since we experimented mostly with problems of up to 500 classes, lambda was never higher than 50. Perhaps for 3k classes it doesn't need such a high value of lambda. This in turn would probably lead to very large gradients somewhere in the training (after cross-entropy is sufficiently small) that moves the outputs to nan.

I'd say start with lambda=10 and then increase/decrease to see how performance varies. What network are you using and which codebase (caffe or pytorch), and with which optimizer (adam or SGD)?

from confusion.

lhao0301 avatar lhao0301 commented on July 20, 2024

ok. I would try to decay lambda.
I finetune resnet-50 on pretrained model in caffe.

from confusion.

lhao0301 avatar lhao0301 commented on July 20, 2024

I increase/decay lambda. Both go into NAN finally after different iterations. I try to add gradient clipping but cause a terrible accuracy.

from confusion.

abhimanyudubey avatar abhimanyudubey commented on July 20, 2024

Can you share your prototxt?

from confusion.

lhao0301 avatar lhao0301 commented on July 20, 2024

Train_val prototxt is as follows:
train_val.txt

from confusion.

abhimanyudubey avatar abhimanyudubey commented on July 20, 2024

Thanks. Can you also share the prototxt you generate while using confusion loss? Also, does this go to NaN even without the loss?

from confusion.

lhao0301 avatar lhao0301 commented on July 20, 2024

I have updated the train_val prototxt with confusion loss(the last uploaded prototxt is a mistake ). Without confusion loss, the training process acts normally.

from confusion.

abhimanyudubey avatar abhimanyudubey commented on July 20, 2024

Just took a look at your prototxt. Since I don't have this dataset, I can't test it myself, but I'd give 2 suggestions - i) try with a larger batch-size (32, 64 or 128 if possible), and ii) try with \lambda = 0.01, 0.1, 1 and so on.

from confusion.

lhao0301 avatar lhao0301 commented on July 20, 2024

For limited gpu memory, I set batch-size to 24 and set iter_size to 4(so batch size is 24 * 4 actually). That lambda is less than 1 is what I have not tried. Thanks!

from confusion.

Related Issues (12)

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.