This project is an extension of the Institute of 1122 - NCKU Data Science's Deep Learning HW2 requirement. It aims to introduce an open framework to the standard training process, enhancing its scalability and usability. Users can easily integrate updated models or modules into the framework and combine them seamlessly.
Additionally, a straightforward automatic equipment allocation feature has been incorporated to maximize the computational performance of the computing center.
🙈Preliminaries
This project is based on a Python>=3.11 and CUDA Toolkit>=11.8 environment with Windows 11 & Ubuntu 20.04.
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install tqdm
pip install pandas
pip install numpy
pip install psutil
#Optional timm
pip install timm
#Optional DCNv4
cd extra_modules/DCNv4_op
python setup.py build install
⚠️ For alternative installation methods including Conda.
🏃Usage
from divan import DIVAN
if __name__ == '__main__':
model = DIVAN('resnet34.yaml')
model.fit('dataset',
epochs=100,
warnup_step=5,
endstep_epochs=20,
endstep_patience=3,
endstep_factor=0.5,
batch_size=128,
cutmix_p=0,
label_smoothing=0.0,
lr=0.0005,
early_stopping=48,
RAM=True)
from divan import DIVAN
if __name__ == '__main__':
model = DIVAN('divan_result/train/resnet34-1/weight/last.pt')
model.fit('dataset',
epochs=100,
warnup_step=5,
endstep_epochs=20,
endstep_patience=3,
endstep_factor=0.5,
batch_size=128,
cutmix_p=0,
label_smoothing=0.0,
lr=0.0005,
early_stopping=48,
RAM=True)
⚠️ In custom models, you can append "-{scale name}" to the YAML file name to specify model parameter scaling.support scale: "n", "s", "m", "l", "x"
For example, use "C2f-DCNv4-x.yaml".
from divan import DIVAN
if __name__ == '__main__':
model = DIVAN('C2f-DCNv4-x.yaml')
model.fit('dataset',
epochs=100,
warnup_step=5,
endstep_epochs=20,
endstep_patience=3,
endstep_factor=0.5,
batch_size=128,
cutmix_p=0,
label_smoothing=0.0,
lr=0.0005,
early_stopping=48,
RAM=True)
⚠️ After the training is completed, the training process information and parameters will be recorded in: divan_result/train/{yaml_name}-{id} (e.g., divan_result/train/resnet34-1).
📑Menu
email: [email protected]
DIVANet is built with reference to the code of the following projects:
Thanks for their awesome work!
✅ Continuing training
📝 wandb support
📝 Unified log management
📝 Distributed Data Parallel
📝 Separate testing function
This is presented as my second practical exercise, and feedback or issues are welcome on GitHub.