diff --git a/fluid/PaddleCV/video/models/nextvlad/nextvlad.py b/fluid/PaddleCV/video/models/nextvlad/nextvlad.py index b9dc851f29edb1d8022cec82991d9ed402c9e6d4..dd1de1011c789132c1b44785182211606534f2bc 100755 --- a/fluid/PaddleCV/video/models/nextvlad/nextvlad.py +++ b/fluid/PaddleCV/video/models/nextvlad/nextvlad.py @@ -58,7 +58,6 @@ class NEXTVLAD(ModelBase): # other params self.batch_size = self.get_config_from_sec(self.mode, 'batch_size') - self.list = self.get_config_from_sec(self.mode, 'filelist') def build_input(self, use_pyreader=True): rgb_shape = [self.video_feature_size] @@ -148,23 +147,6 @@ class NEXTVLAD(ModelBase): self.label_input ] - def create_dataset_args(self): - dataset_args = {} - dataset_args['num_classes'] = self.num_classes - if self.use_gpu and self.py_reader: - dataset_args['batch_size'] = int(self.batch_size / self.num_gpus) - else: - dataset_args['batch_size'] = self.batch_size - dataset_args['list'] = self.list - dataset_args['eigen_file'] = self.eigen_file - return dataset_args - - def create_metrics_args(self): - metrics_args = {} - metrics_args['num_classes'] = self.num_classes - metrics_args['topk'] = 20 - return metrics_args - def get_learning_rate_decay_list(base_learning_rate, decay, max_iter, decay_examples, total_batch_size): diff --git a/fluid/PaddleCV/video/models/stnet/stnet.py b/fluid/PaddleCV/video/models/stnet/stnet.py index c2b4e139fa8d186584e31a721ce756a167ba736c..72e2339e12636b20109a60b78679005f47fe345f 100644 --- a/fluid/PaddleCV/video/models/stnet/stnet.py +++ b/fluid/PaddleCV/video/models/stnet/stnet.py @@ -26,7 +26,6 @@ class STNET(ModelBase): self.get_config() def get_config(self): - self.format = self.get_config_from_sec('model', 'format') self.num_classes = self.get_config_from_sec('model', 'num_classes') self.seg_num = self.get_config_from_sec('model', 'seg_num') self.seglen = self.get_config_from_sec('model', 'seglen') @@ -43,16 +42,9 @@ class STNET(ModelBase): self.l2_weight_decay = self.get_config_from_sec('train', 'l2_weight_decay') self.momentum = self.get_config_from_sec('train', 'momentum') - self.use_gpu = self.get_config_from_sec('train', 'use_gpu') - self.num_gpus = self.get_config_from_sec('train', 'num_gpus') - self.short_size = self.get_config_from_sec(self.mode, 'short_size') self.target_size = self.get_config_from_sec(self.mode, 'target_size') - self.num_reader_threads = self.get_config_from_sec(self.mode, - 'num_reader_threads') - self.buf_size = self.get_config_from_sec(self.mode, 'buf_size') self.batch_size = self.get_config_from_sec(self.mode, 'batch_size') - self.filelist = self.get_config_from_sec(self.mode, 'filelist') def build_input(self, use_pyreader=True): image_shape = [3, self.target_size, self.target_size] @@ -130,29 +122,6 @@ class STNET(ModelBase): self.label_input ] - def create_dataset_args(self): - cfg = {} - cfg['format'] = self.format - cfg['num_classes'] = self.num_classes - cfg['seg_num'] = self.seg_num - cfg['seglen'] = self.seglen - cfg['short_size'] = self.short_size - cfg['target_size'] = self.target_size - cfg['num_reader_threads'] = self.num_reader_threads - cfg['buf_size'] = self.buf_size - cfg['image_mean'] = self.image_mean - cfg['image_std'] = self.image_std - cfg['list'] = self.filelist - if (self.use_gpu) and (self.py_reader is not None): - cfg['batch_size'] = int(self.batch_size / self.num_gpus) - else: - cfg['batch_size'] = self.batch_size - - return cfg - - def create_metrics_args(self): - return {} - def load_pretrain_params(self, exe, pretrain, prog): def is_parameter(var): if isinstance(var, fluid.framework.Parameter): diff --git a/fluid/PaddleCV/video/models/tsn/tsn.py b/fluid/PaddleCV/video/models/tsn/tsn.py index 7ad9818e6b4dee3dd16cf5e163bdb11db80e5912..19b739d1ebd88a91006a8b7f49c9374978fae692 100644 --- a/fluid/PaddleCV/video/models/tsn/tsn.py +++ b/fluid/PaddleCV/video/models/tsn/tsn.py @@ -27,7 +27,6 @@ class TSN(ModelBase): self.get_config() def get_config(self): - self.format = self.get_config_from_sec('model', 'format') self.num_classes = self.get_config_from_sec('model', 'num_classes') self.seg_num = self.get_config_from_sec('model', 'seg_num') self.seglen = self.get_config_from_sec('model', 'seglen') @@ -44,16 +43,9 @@ class TSN(ModelBase): self.l2_weight_decay = self.get_config_from_sec('train', 'l2_weight_decay') self.momentum = self.get_config_from_sec('train', 'momentum') - self.use_gpu = self.get_config_from_sec('train', 'use_gpu') - self.num_gpus = self.get_config_from_sec('train', 'num_gpus') - self.short_size = self.get_config_from_sec(self.mode, 'short_size') self.target_size = self.get_config_from_sec(self.mode, 'target_size') - self.num_reader_threads = self.get_config_from_sec(self.mode, - 'num_reader_threads') - self.buf_size = self.get_config_from_sec(self.mode, 'buf_size') self.batch_size = self.get_config_from_sec(self.mode, 'batch_size') - self.filelist = self.get_config_from_sec(self.mode, 'filelist') def build_input(self, use_pyreader=True): image_shape = [3, self.target_size, self.target_size] @@ -133,26 +125,3 @@ class TSN(ModelBase): return self.feature_input if self.mode == 'infer' else self.feature_input + [ self.label_input ] - - def create_dataset_args(self): - cfg = {} - cfg['format'] = self.format - cfg['num_classes'] = self.num_classes - cfg['seg_num'] = self.seg_num - cfg['seglen'] = self.seglen - cfg['short_size'] = self.short_size - cfg['target_size'] = self.target_size - cfg['num_reader_threads'] = self.num_reader_threads - cfg['buf_size'] = self.buf_size - cfg['image_mean'] = self.image_mean - cfg['image_std'] = self.image_std - cfg['list'] = self.filelist - if self.use_gpu and (self.py_reader is not None): - cfg['batch_size'] = int(self.batch_size / self.num_gpus) - else: - cfg['batch_size'] = self.batch_size - - return cfg - - def create_metrics_args(self): - return {} diff --git a/fluid/PaddleCV/video/scripts/infer/infer_nextvlad.sh b/fluid/PaddleCV/video/scripts/infer/infer_nextvlad.sh index 1a96980106bbda1fc3678785323904a4ccecaa65..a78537483a21ceb419282bddbcfea6a0829ab5c7 100644 --- a/fluid/PaddleCV/video/scripts/infer/infer_nextvlad.sh +++ b/fluid/PaddleCV/video/scripts/infer/infer_nextvlad.sh @@ -1,3 +1,3 @@ -python infer.py --model-name="NEXTVLAD" --config=./configs/nextvlad.txt --filelist=./data/youtube8m/infer.list \ +python3 infer.py --model-name="NEXTVLAD" --config=./configs/nextvlad.txt --filelist=./data/youtube8m/infer.list \ --weights=./checkpoints/NEXTVLAD_epoch0 \ --save-dir="./save" diff --git a/fluid/PaddleCV/video/scripts/infer/infer_stnet.sh b/fluid/PaddleCV/video/scripts/infer/infer_stnet.sh index 8b27a234d9a650b3e4acf8d9dae5ba1bb68fc71b..f661ae8842cd2632a5220967589c816298cc58b4 100644 --- a/fluid/PaddleCV/video/scripts/infer/infer_stnet.sh +++ b/fluid/PaddleCV/video/scripts/infer/infer_stnet.sh @@ -1,2 +1,2 @@ -python infer.py --model-name="STNET" --config=./configs/stnet.txt --filelist=./data/kinetics/infer.list \ +python3 infer.py --model-name="STNET" --config=./configs/stnet.txt --filelist=./data/kinetics/infer.list \ --log-interval=10 --weights=./checkpoints/STNET_epoch0 --save-dir=./save diff --git a/fluid/PaddleCV/video/scripts/infer/infer_tsn.sh b/fluid/PaddleCV/video/scripts/infer/infer_tsn.sh index 515feaf4a502bb35691d357a038f702345e9b9a2..506e0bf115e5922585977dc7a32786bbf2a35f31 100644 --- a/fluid/PaddleCV/video/scripts/infer/infer_tsn.sh +++ b/fluid/PaddleCV/video/scripts/infer/infer_tsn.sh @@ -1,2 +1,2 @@ -python infer.py --model-name="TSN" --config=./configs/tsn.txt --filelist=./data/kinetics/infer.list \ +python3 infer.py --model-name="TSN" --config=./configs/tsn.txt --filelist=./data/kinetics/infer.list \ --log-interval=10 --weights=./checkpoints/TSN_epoch0 --save-dir=./save diff --git a/fluid/PaddleCV/video/scripts/test/test_nextvlad.sh b/fluid/PaddleCV/video/scripts/test/test_nextvlad.sh index 239e9980153303a161511a217a09a4d63b216e3b..34045958105262c20181ff5b7dd26c3e70b67744 100644 --- a/fluid/PaddleCV/video/scripts/test/test_nextvlad.sh +++ b/fluid/PaddleCV/video/scripts/test/test_nextvlad.sh @@ -1,2 +1,2 @@ -python test.py --model-name="NEXTVLAD" --config=./configs/nextvlad.txt \ +python3 test.py --model-name="NEXTVLAD" --config=./configs/nextvlad.txt \ --log-interval=10 --weights=./checkpoints/NEXTVLAD_epoch0 diff --git a/fluid/PaddleCV/video/scripts/test/test_stnet.sh b/fluid/PaddleCV/video/scripts/test/test_stnet.sh index 6913ea6970f5448d83b72c5fe8f3b9c05925d9a8..216faa95f11975e4bf1b827cdd8ace7ada450f93 100644 --- a/fluid/PaddleCV/video/scripts/test/test_stnet.sh +++ b/fluid/PaddleCV/video/scripts/test/test_stnet.sh @@ -1,2 +1,2 @@ -python test.py --model-name="STNET" --config=./configs/stnet.txt \ +python3 test.py --model-name="STNET" --config=./configs/stnet.txt \ --log-interval=10 --weights=./checkpoints/STNET_epoch0 diff --git a/fluid/PaddleCV/video/scripts/test/test_tsn.sh b/fluid/PaddleCV/video/scripts/test/test_tsn.sh index b66bcb2cf08fbcccef1954369dd53d6e61b0894a..3b5b446614a1d9e20ef38cea9f0b0b55de753286 100644 --- a/fluid/PaddleCV/video/scripts/test/test_tsn.sh +++ b/fluid/PaddleCV/video/scripts/test/test_tsn.sh @@ -1,2 +1,2 @@ -python test.py --model-name="TSN" --config=./configs/tsn.txt \ +python3 test.py --model-name="TSN" --config=./configs/tsn.txt \ --log-interval=10 --weights=./checkpoints/TSN_epoch0 diff --git a/fluid/PaddleCV/video/scripts/train/train_nextvlad.sh b/fluid/PaddleCV/video/scripts/train/train_nextvlad.sh index 1bf79c2fd24b49d2ad5a3c3102e00b75db9ee337..a35635eda922be27c7b7d31ebd63c14aed0bd489 100644 --- a/fluid/PaddleCV/video/scripts/train/train_nextvlad.sh +++ b/fluid/PaddleCV/video/scripts/train/train_nextvlad.sh @@ -1,3 +1,2 @@ -export CUDA_VISIBLE_DEVICES=0,1,2,3 -python train.py --model-name="NEXTVLAD" --config=./configs/nextvlad.txt --epoch-num=6 \ +python3 train.py --model-name="NEXTVLAD" --config=./configs/nextvlad.txt --epoch-num=6 \ --valid-interval=1 --save-interval=1 --log-interval=10 diff --git a/fluid/PaddleCV/video/scripts/train/train_stnet.sh b/fluid/PaddleCV/video/scripts/train/train_stnet.sh index 4d9c3cbe3adb32926cdae041bbebaf8b1ae062b4..df60441aec7262d7a3f32483174433385884725c 100644 --- a/fluid/PaddleCV/video/scripts/train/train_stnet.sh +++ b/fluid/PaddleCV/video/scripts/train/train_stnet.sh @@ -1,2 +1,2 @@ -python train.py --model-name="STNET" --config=./configs/stnet.txt --epoch-num=6 \ +python3 train.py --model-name="STNET" --config=./configs/stnet.txt --epoch-num=6 \ --valid-interval=1 --save-interval=1 --log-interval=10 diff --git a/fluid/PaddleCV/video/scripts/train/train_tsn.sh b/fluid/PaddleCV/video/scripts/train/train_tsn.sh index d125f0bf57cac27db59646dcbe39d73cf61f3f90..c08b5381b98feaed252eb09e5d8a315f08e64176 100644 --- a/fluid/PaddleCV/video/scripts/train/train_tsn.sh +++ b/fluid/PaddleCV/video/scripts/train/train_tsn.sh @@ -1,2 +1,2 @@ -python train.py --model-name="TSN" --config=./configs/tsn.txt --epoch-num=6 \ +python3 train.py --model-name="TSN" --config=./configs/tsn.txt --epoch-num=6 \ --valid-interval=1 --save-interval=1 --log-interval=10