Add Conv2() module (#2820)

This commit is contained in:
Glenn Jocher
2023-05-25 18:12:50 +02:00
committed by GitHub
parent d19c5b6ce8
commit 441e67d330
13 changed files with 92 additions and 45 deletions

View File

@ -48,23 +48,25 @@ trainer.train()
You now realize that you need to customize the trainer further to:
* * Customize the `loss function`.
* Customize the `loss function`.
* Add `callback` that uploads model to your Google Drive after every 10 `epochs`
Here's how you can do it:
```python
from ultralytics.yolo.v8.detect import DetectionTrainer
from ultralytcs.nn.tasks import DetectionModel
from ultralytics.nn.tasks import DetectionModel
class MyCustomModel(DetectionModel):
def init_criterion():
...
def init_criterion(self):
...
class CustomTrainer(DetectionTrainer):
def get_model(self, cfg, weights):
return MyCustomModel(...)
# callback to upload model weights
def log_model(trainer):
last_weight_path = trainer.last