Code Monkey home page Code Monkey logo

Comments (8)

dagshub avatar dagshub commented on June 16, 2024

Join the discussion on DagsHub!

from super-gradients.

NatanBagrov avatar NatanBagrov commented on June 16, 2024

Hello, could you please rephrase your question?

from super-gradients.

TapendraBaduwal avatar TapendraBaduwal commented on June 16, 2024

@NatanBagrov Lets my 1st model train on A ,B,C class...In next time i want to train My pre-train 1st model by adding D class ...(Note: In second time training I do not want to mix all data...i just want to train new D class). Final model must detect A, B, C, D class.

from super-gradients.

NatanBagrov avatar NatanBagrov commented on June 16, 2024

I understand.

Please close the duplicate issue you created, #922 .

To achieve that you will need to modify the head to include additional new classes (=kernels), in your example, it has original 3 kernels, then you need to change to 4 kernels. Also, I would freeze the entire backbone, neck and original part of the head, and fine-tune only the "new" kernels.

This is somehow similar to #892

from super-gradients.

TapendraBaduwal avatar TapendraBaduwal commented on June 16, 2024

@NatanBagrov Can you guide me How to modify the head to include additional new classes (=kernels) i found only kernel_size=3 ...i have to change self.num_classes am i right ? is there any config yml file to change self.num_classes from yml file ?

Also how to freeze the entire backbone, neck and original part of the head can you guide me i am new here from where i have to freeze dynamically....shall we need to unfeeze also?

And how to finetune only the "new" kernels class after freeze the entire backbone, neck and original part of the head?

I am new here guide me with the help of code point i would be a great help.

from super-gradients.

NatanBagrov avatar NatanBagrov commented on June 16, 2024

Hello, I will elaborate with general guidelines, and will leave the implementation to you.

  • If you change number of classes, you will not be able to re-use the checkpoint, so you need to do the modification after you have loaded the pre-trained checkpoint with the original number of classes.
  • I would create a wrapper, that will take the model (already loaded), and will expand cls_preds with the extended filters (=kernels), that is, use the filters of the original classes, but also add uninitialized ones for the new classes. Then it is fine to change num_classes.
  • To freeze parts of the model, you can read Torch documentation on how to achieve that. Here's a reference to a forum thread with some info.

Good luck!

from super-gradients.

TapendraBaduwal avatar TapendraBaduwal commented on June 16, 2024

@NatanBagrov after freeze the entire backbone, neck and original part of the head....how my fine-tune "new" kernels learns without backbone, neck and original part of the head ? Shall i need to add some layer for that?

from super-gradients.

NatanBagrov avatar NatanBagrov commented on June 16, 2024

You have the suggested fine-tune recipes in our documentation. You just launch training. The backbone and the neck already learned to extract valuable features, so only your "new" filters need to learn how to "classify" the new classes based on these features.

from super-gradients.

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.