Skip to content

Commit

Permalink
Fix imports in the train script (#379)
Browse files Browse the repository at this point in the history
Summary:
use omnivore directory as the root for imports

Pull Request resolved: #379

Test Plan:
torchrun --nproc_per_node=8 --nnodes=1 -m omnivore.train     --batch-size=128 --workers=6 --model="omnivore_swin_t"     --cache-video-dataset     --extra-video-dataloader-workers=7     --kinetics-dataset-workers=12     --val-resize-size=224     --video-grad-accum-iter=32     --modalities image video rgbd     --val-data-sampling-factor 1 1 1     --test-only --pretrained --imagenet-data-path=/datasets01_ontap/imagenet_full_size/061417 --kinetics-data-path=/datasets01_ontap/kinetics/070618/400 --sunrgbd-data-path=/data/home/yosuamichael/datasets/SUN_RGBD

[2022-11-23 04:12:32,122] INFO - Test:  rgbd Acc@1 61.964 rgbd Acc@5 87.822
[2022-11-23 04:12:32,122] INFO - Test:  Video Acc@1 77.985 Video Acc@5 93.462
[2022-11-23 04:12:32,122] INFO - Test:  rgbd Acc@1 61.964 rgbd Acc@5 87.822

Reviewed By: YosuaMichael

Differential Revision: D41501394

Pulled By: ankitade

fbshipit-source-id: f0363a81ee195e99041c74d9fe0475c4098625d8
  • Loading branch information
ankitade authored and facebook-github-bot committed Nov 23, 2022
1 parent d2ba452 commit 152f7e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions examples/omnivore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ root

Example command to run training on ImageNet1K, Kinetics400, and SunRGBD datasets
```
torchrun --nproc_per_node=8 --nnodes=8 train.py \
torchrun --nproc_per_node=8 --nnodes=8 -m omnivore.train \
--batch-size=128 --workers=6 --extra-video-dataloader-workers=6 \
--cache-video-dataset --eval-every-num-epoch=10 --model="omnivore_swin_t" \
--lr=0.002 --lr-warmup-epochs=25 --lr-warmup-method=linear \
Expand All @@ -129,8 +129,8 @@ torchrun --nproc_per_node=8 --nnodes=8 train.py \

Example command to run evaluation on Omnivore with Swin Transformer Tiny variant.
```
torchrun --nproc_per_node=8 --nnodes=1 train.py \
--batch-size=128 --workers=6 --mode="omnivore_swin_t" \
torchrun --nproc_per_node=8 --nnodes=1 -m omnivore.train \
--batch-size=128 --workers=6 --model="omnivore_swin_t" \
--cache-video-dataset \
--extra-video-dataloader-workers=7 \
--kinetics-dataset-workers=12 \
Expand Down
4 changes: 2 additions & 2 deletions examples/omnivore/data/data_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
import os
import time

import examples.omnivore.utils as utils
import omnivore.utils as utils
import torch
import torchvision
import torchvision.datasets.samplers as video_samplers
from examples.omnivore.data import datasets, presets, transforms
from omnivore.data import datasets, presets, transforms
from torch.utils.data.dataloader import default_collate
from torchvision.transforms.functional import InterpolationMode

Expand Down
4 changes: 2 additions & 2 deletions examples/omnivore/data/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

import examples.omnivore.data.transforms as CT # custom transforms
import omnivore.data.transforms as CT # custom transforms
import torch
import torchvision.transforms as T
from examples.omnivore.data.rand_aug3d import RandAugment3d
from omnivore.data.rand_aug3d import RandAugment3d
from torchvision.transforms.functional import InterpolationMode


Expand Down
4 changes: 2 additions & 2 deletions examples/omnivore/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import os
import time

import examples.omnivore.data.data_builder as data_builder
import examples.omnivore.utils as utils
import omnivore.data.data_builder as data_builder

import torch
import torch.utils.data
import torchmultimodal.models.omnivore as omnivore
from omnivore import utils
from torch import nn


Expand Down

0 comments on commit 152f7e0

Please sign in to comment.