Closed phucnhs closed 4 years ago
Hello @phucnhs, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook , Docker Image, and Google Cloud Quickstart Guide for example environments.
If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.
If this is a custom model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:
For more information please visit https://www.ultralytics.com.
@phucnhs you can replace existing activations in any of the default modules in models/common.py or models/experimental.py. Most modules use common.Conv()
, which is our basic lower level convolutional module. Replacing the LeakyReLU() activation here will have the greatest effect on YOLOv5 models. You can always print(model)
to see the effects of your changes.
Thanks bro ! I see try and close issues !
I changed the common.py to self.act = nn.ReLU() if act is True else (act if isinstance(act, nn.Module) else nn.Identity()) but there is no change in print(model): ... (act): SiLU(inplace=True) ...
but when I change "SiLU" in yolov5.pt then print(model): ... (act): ReLU(inplace=True) ...
@PariaDarbani activation functions can be modified here for training custom models: https://github.com/ultralytics/yolov5/blob/306fc0119a94915b91fb6ca6f46f2d50437152e3/models/common.py#L43
@PariaDarbani activation functions can be modified here for training custom models: https://github.com/ultralytics/yolov5/blob/306fc0119a94915b91fb6ca6f46f2d50437152e3/models/common.py#L43
I am using inference mode, not training. I want to change the activation function (SiLU) to ReLU for pre-trained yolov5s. I changed the common.py but it doesn't work.
@PariaDarbani you never change a model at inference time, you use a fully trained model.
You can modify a model before training starts.
❔Question
Hi ! How to use activation function FRELU,MISH....in source code ? Thanks !
Additional context