Skip to content

Instantly share code, notes, and snippets.

@Aquaakuma
Aquaakuma / custom_tracker.py
Last active July 15, 2025 03:37
自定义accelerate追踪器的tensorboard类
from torch.utils.tensorboard import SummaryWriter
from accelerate.tracking import GeneralTracker, on_main_process
import os
from typing import Union, Optional
# 0. 自定义追踪器
class MyCustomTracker(GeneralTracker):
"""
my custom `Tracker` class that supports `tensorboard`. Should be initialized at the start of your script.