Skip to content

Commit

Permalink
Minc fix (zhanghang1989#294)
Browse files Browse the repository at this point in the history
* rm cifar exp

* minc dataset

* test

* fix doc

Co-authored-by: hzaws <hzaws@u8bc4deae3e4a50.ant.amazon.com>
  • Loading branch information
zhanghang1989 and hzaws authored Jul 5, 2020
1 parent 39ccc24 commit e219aa7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/source/tutorials/texture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ Test Pre-trained Model

- Test pre-trained model on MINC-2500. The pre-trained weight will be automatic downloaded (pre-trained on train-1 split using single training size of 224, with an error rate of :math:`18.96\%` using single crop on test-1 set)::

python main.py --dataset minc --model deepten_resnet50_minc --nclass 23 --pretrained --eval
python verify.py --dataset minc --model deepten_resnet50_minc
# Teriminal Output:
# Loss: 0.995 | Err: 18.957% (1090/5750): 100%|████████████████████| 23/23 [00:18<00:00, 1.26it/s]
# Top1: 81.043 | Top5: 95.617: 100%|███████████████████████████████████| 45/45 [00:18<00:00, 2.40it/s]
# Top1 Acc: 81.043 | Top5 Acc: 95.617


Train Your Own Model
--------------------

- Example training command for training above model::

CUDA_VISIBLE_DEVICES=0,1,2,3 python main.py --dataset minc --model deepten_resnet50_minc --batch-size 512 --lr 0.004 --epochs 80 --lr-step 60 --lr-scheduler step --weight-decay 5e-4
CUDA_VISIBLE_DEVICES=0,1,2,3 python train_dist.py --dataset minc --model deepten_resnet50_minc --batch-size 512 --lr 0.004 --epochs 80 --lr-step 60 --lr-scheduler step --weight-decay 5e-4

- Detail training options::

Expand Down
6 changes: 4 additions & 2 deletions encoding/datasets/minc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

class MINCDataset(data.Dataset):
NUM_CLASS = 23
def __init__(self, root=os.path.expanduser('~/.encoding/data/minc-2500/'),
split='train', transform=None):
def __init__(self, root=os.path.expanduser('~/.encoding/data/'),
train=True, transform=None, download=None):
split='train' if train == True else 'val'
root = os.path.join(root, 'minc-2500')
self.transform = transform
classes, class_to_idx = find_classes(root + '/images')
if split=='train':
Expand Down

0 comments on commit e219aa7

Please sign in to comment.