Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments to zoo to support dls-cli #388

Draft
wants to merge 23 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ script:
- pylint deeplite_torch_zoo/utils/ --ignore-docstrings yes --ignore-comments yes --disable=W0614,W0401,W0613,C0301,E0401,C0415
- pytest
- codecov
- python training_scripts/object_detection/train.py --model_name yolo8n --dataset coco8 --dryrun
- python training_scripts/classification/ultralytics/train.py --model resnet12 --dataset imagewoof_160 --dryrun
- python training_scripts/classification/cifar/train_cifar.py --model resnet18 --dataset cifar100 --dryrun
- python training_scripts/classification/imagenet/train.py --data-dir ./ --dataset imagewoof_160 --model resnet12 --dryrun --dataset-download
- python deeplite_torch_zoo/training_scripts/object_detection/train.py --model yolo8n --dataset coco8 --dryrun
- python deeplite_torch_zoo/training_scripts/classification/ultralytics/train.py --model resnet12 --dataset imagewoof_160 --dryrun
- python deeplite_torch_zoo/training_scripts/classification/cifar/train_cifar.py --model resnet18 --dataset cifar100 --dryrun
- python deeplite_torch_zoo/training_scripts/classification/imagenet/train.py --data-dir ./ --dataset imagewoof_160 --model resnet12 --dryrun --dataset-download

before_deploy:
- pip install markupsafe==2.0.1
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
recursive-include deeplite_torch_zoo/src *.yaml
recursive-include deeplite_torch_zoo/api *.yaml
recursive-include deeplite_torch_zoo/api *.yaml
recursive-include deeplite_torch_zoo/training_scripts *.yaml
recursive-include deeplite_torch_zoo/training_scripts *.py
alexh-deeplite marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
Binary file not shown.
Binary file not shown.
alexh-deeplite marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
data_root: /neutrino/datasets/flower-102/
model: resnet18
dataset: flower102
pretraining_dataset: flower102
epochs: 1
batch_size: 16
test_batch_size: 256
imgsz: 640
nosave: false
device: '[0,1,2,3]'
workers: 8
project: /home/sougata.pal/deeplite-torch-zoo/training_scripts/classification/ultralytics/runs/train-cls
name: exp
exist_ok: false
pretrained: true
optimizer: Adam
lr0: 0.001
decay: 5.0e-05
label_smoothing: 0.1
verbose: false
seed: 0
local_rank: -1
kd_model_name: null
kd_model_checkpoint: null
alpha_kd: 5
use_kd_loss_only: false
dryrun: false
save_dir: /home/sougata.pal/deeplite-torch-zoo/training_scripts/classification/ultralytics/runs/train-cls/exp
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
data_root: /neutrino/datasets/flowers-102/
model: resnet18
dataset: flowers102
pretraining_dataset: flowers102
epochs: 1
batch_size: 16
test_batch_size: 256
imgsz: 640
nosave: false
device: '[0,1,2,3]'
workers: 8
project: /home/sougata.pal/deeplite-torch-zoo/training_scripts/classification/ultralytics/runs/train-cls
name: exp
exist_ok: false
pretrained: true
optimizer: Adam
lr0: 0.001
decay: 5.0e-05
label_smoothing: 0.1
verbose: false
seed: 0
local_rank: -1
kd_model_name: null
kd_model_checkpoint: null
alpha_kd: 5
use_kd_loss_only: false
dryrun: false
save_dir: /home/sougata.pal/deeplite-torch-zoo/training_scripts/classification/ultralytics/runs/train-cls/exp2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
epoch, train/loss, metrics/accuracy_top1, metrics/accuracy_top5, lr/0
0, 2.4841, 0.55993, 0.81656, 1e-05
Binary file not shown.
Binary file not shown.
Binary file not shown.
alexh-deeplite marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
lr0: 0.01
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.05
cls: 0.5
cls_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.0
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 1.0
mixup: 0.0
copy_paste: 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
model_name: yolo5n
pretrained: true
pretraining_dataset: coco
data_root: /neutrino/datasets/VOCdevkit/
dataset: voc
hyp:
lr0: 0.01
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.05
cls: 0.5
cls_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.0
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 1.0
mixup: 0.0
copy_paste: 0.0
epochs: 1
batch_size: 16
imgsz: 640
rect: false
nosave: false
noval: false
noautoanchor: false
cache: null
image_weights: false
device: '[0,1,2,3]'
multi_scale: false
single_cls: false
optimizer: SGD
sync_bn: false
workers: 8
project: runs/train
name: exp
exist_ok: false
quad: false
cos_lr: false
label_smoothing: 0.0
patience: 100
freeze:
- 0
save_period: -1
seed: 0
no_amp: false
local_rank: -1
dryrun: false
save_dir: runs/train/exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
lr0: 0.01
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.05
cls: 0.5
cls_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.0
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 1.0
mixup: 0.0
copy_paste: 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
model_name: yolo5n
pretrained: true
pretraining_dataset: voc
data_root: /neutrino/datasets/VOCdevkit/
dataset: voc
hyp:
lr0: 0.01
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.05
cls: 0.5
cls_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.0
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 1.0
mixup: 0.0
copy_paste: 0.0
epochs: 1
batch_size: 16
imgsz: 640
rect: false
nosave: false
noval: false
noautoanchor: false
cache: null
image_weights: false
device: '[0,1,2,3]'
multi_scale: false
single_cls: false
optimizer: SGD
sync_bn: false
workers: 8
project: runs/train
name: exp
exist_ok: false
quad: false
cos_lr: false
label_smoothing: 0.0
patience: 100
freeze:
- 0
save_period: -1
seed: 0
no_amp: false
local_rank: -1
dryrun: false
save_dir: runs/train/exp2
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def train(opt, device): # hyp is path/to/hyp.yaml or hyp dictionary

# Image size
model = get_model(
model_name=opt.model_name,
model_name=opt.model,
dataset_name=opt.pretraining_dataset,
pretrained=False,
).to(device)
Expand Down Expand Up @@ -105,7 +105,7 @@ def train(opt, device): # hyp is path/to/hyp.yaml or hyp dictionary

# Model
model = get_model(
model_name=opt.model_name,
model_name=opt.model,
dataset_name=opt.pretraining_dataset,
pretrained=opt.pretrained,
num_classes=nc,
Expand Down Expand Up @@ -163,7 +163,7 @@ def train(opt, device): # hyp is path/to/hyp.yaml or hyp dictionary

eval_function = get_eval_function(
dataset_name=opt.dataset,
model_name=opt.model_name,
model_name=opt.model,
)

# DDP mode
Expand Down Expand Up @@ -352,7 +352,7 @@ def train(opt, device): # hyp is path/to/hyp.yaml or hyp dictionary

def parse_opt(known=False):
parser = argparse.ArgumentParser()
parser.add_argument('--model_name', type=str, default='yolo5s', help='zoo model name')
parser.add_argument('--model', type=str, default='yolo5s', help='zoo model name')
parser.add_argument('--pretrained', action='store_true')
parser.add_argument('--pretraining_dataset', type=str, default='coco')
parser.add_argument('--data_root', type=str, default=None, help='dataset path')
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
license = f.read()

with open('README.md') as f:
long_description = f.read()
long_description = "" # f.read()
alexh-deeplite marked this conversation as resolved.
Show resolved Hide resolved


# Package
Expand All @@ -33,7 +33,7 @@
'pandas',
'tensorboard>=2.11.2',
'openmim==0.3.7',
'super-gradients==3.3.0',
'super-gradients==3.3.0'
]

if sys.version_info.minor > 7:
Expand Down