YouHuang67 / InterFormer

MIT License
35 stars 5 forks source link

Training code #5

Closed che1007 closed 9 months ago

che1007 commented 9 months ago

I'm sorry to bother you again. I have been tracing your code, but I still cannot find the training code that consists of the complete training flow. Could you give me a hint?

YouHuang67 commented 9 months ago

I understand you're having trouble locating the complete training flow in this repository. Let me clarify a few points to assist you:

This repository utilizes the OpenMMLab 1.0 series code framework. The direct implementation code for training or testing cannot be easily located through code hints in the editor.

The best way to navigate and find specific pieces of code is through file search. For example, you can directly search for the code line model = dict(type='ClickSegmentor') in the model configuration file configs/base/interformer_tiny.py. This approach will help you locate the specific implementation of ClickSegmentor in the repository.

This search should lead you to the ClickSegmentor code under interformer/segmentors/click.py.

The specific training process is implemented in the interact_train function within the ClickSegmentor class.

At the top of the ClickSegmentor class definition, there is a line @SEGMENTORS.register_module(). This is the registration of the class, which allows the training script tools/train.py to find this class based on the aforementioned configuration file. The reason why it's not straightforward to find the actual training code in the editor is due to this registration mechanism.

I also encountered similar issues when I first used this code framework. After gaining a better understanding of the MMLab series, I found it to be well-structured. Hence, InterFormer has adopted this framework. You can learn more about the MMLab frameworks at https://github.com/open-mmlab. It's worth noting that they are now on their 2.0 series, which includes some upgrades, so there might be slight discrepancies between some documentation and the code in this repository.

I hope this explanation helps you navigate and understand the code structure better.

che1007 commented 9 months ago

Thank for your help!