This page guide users to freeze module in YOLOX.
Exp controls everything in YOLOX, so let's start from creating an Exp object.
We take an example of YOLOX-S model on COCO dataset to give a more clear guide.
Import the config you want (or write your own Exp object inherit from yolox.exp.BaseExp
).
from yolox.exp.default.yolox_s import Exp as MyExp
Here is a simple code to freeze backbone (FPN not included) of module.
class Exp(MyExp):
def get_model(self):
from yolox.utils import freeze_module
model = super().get_model()
freeze_module(model.backbone.backbone)
return model
if you only want to freeze FPN, freeze_module(model.backbone)
might help.
Suppose that the path of your Exp is /path/to/my_exp.py
, use the following command to train your model.
python3 -m yolox.tools.train -f /path/to/my_exp.py
For more details of training, run the following command.
python3 -m yolox.tools.train --help