"mmdet3d/structures/bbox_3d/cam_box3d.py" did not exist on "a05dff6fe44ffcdf598b9189877c1a6d83e01a40"
Commit 78e8e038 authored by Sugon_ldc's avatar Sugon_ldc
Browse files

add new model

parents
#!/usr/bin/env bash
export HIP_VISIBLE_DEVICES=0,1,2,3
python -m torch.distributed.run --nproc_per_node 4 train.py --batch-size=128 --mode=small --print-freq=1 --dataset=CIFAR10 --ema-decay=0 --label-smoothing=0 --lr=0.2 --save-epoch-freq=10 --lr-decay=cos --lr-min=0 --warmup-epochs=5 --weight-decay=6e-5 --num-epochs=400 --num-workers=2 --width-multiplier=1 --data-dir /data/ --save-path /data/mobilenetv3out/ $1 $2
# -*- coding: UTF-8 -*-
'''
statistical information and display
Ref: https://github.com/pytorch/examples/blob/master/imagenet/main.py
'''
import torch
def accuracy(output, target, topk=(1,)):
'''
Computes the accuracy over the k top predictions for the specified values of k
'''
with torch.no_grad():
maxk = max(topk)
batch_size = target.size(0)
_, pred = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, -1).expand_as(pred))
res = []
for k in topk:
correct_k = correct[:k].contiguous().view(-1).float().sum(0, keepdim=True)
res.append(correct_k.mul_(100.0 / batch_size))
return res
class AverageMeter(object):
'''
Computes and stores the average and current value
'''
def __init__(self, name, fmt=':f'):
self.name = name
self.fmt = fmt
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
self.sum += val * n
self.count += n
self.avg = self.sum / self.count
def __str__(self):
# fmtstr = '{name}:{val' + self.fmt + '}(avg:{avg' + self.fmt + '})'
fmtstr = 'Avg {name}:{avg' + self.fmt + '}'
return fmtstr.format(**self.__dict__)
class ProgressMeter(object):
def __init__(self, num_batches, meters, prefix=""):
self.batch_fmtstr = self._get_batch_fmtstr(num_batches)
self.meters = meters
self.prefix = prefix
def display(self, batch):
entries = [self.prefix + self.batch_fmtstr.format(batch)]
entries += [str(meter) for meter in self.meters]
print(' '.join(entries))
def _get_batch_fmtstr(self, num_batches):
num_digits = len(str(num_batches // 1))
fmt = '{:' + str(num_digits) + 'd}'
return '[' + fmt + '/' + fmt.format(num_batches) + ']'
\ No newline at end of file
This diff is collapsed.
python -m torch.distributed.run --nproc_per_node 4 train.py --batch-size=128 --mode=small --print-freq=1 --dataset=CIFAR10 --ema-decay=0 --label-smoothing=0 --lr=0.2 --save-epoch-freq=10 --lr-decay=cos --lr-min=0 --warmup-epochs=5 --weight-decay=6e-5 --num-epochs=400 --num-workers=2 --width-multiplier=1 --data-dir /data/ --save-path /data/mobilenetv3out/ --log_dir /data/pid.txt 2>&1 | tee mobilenetv3_dcu_`date +%Y%m%d%H%M%S`.log
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment