提交 bba5ff2b 编写于 作者: S SunGaofeng

remove redundant code in attention cluster and lstm

上级 26594a1f
...@@ -37,11 +37,6 @@ class AttentionCluster(ModelBase): ...@@ -37,11 +37,6 @@ class AttentionCluster(ModelBase):
self.class_num = self.cfg.MODEL.num_classes #self.cfg.MODEL.class_num self.class_num = self.cfg.MODEL.num_classes #self.cfg.MODEL.class_num
self.drop_rate = self.cfg.MODEL.drop_rate self.drop_rate = self.cfg.MODEL.drop_rate
# get mode configs
self.batch_size = self.get_config_from_sec(self.mode, 'batch_size', 1)
self.use_gpu = self.get_config_from_sec(self.mode, 'use_gpu', True)
self.gpu_num = self.get_config_from_sec(self.mode, 'gpu_num', 1)
if self.mode == 'train': if self.mode == 'train':
self.learning_rate = self.get_config_from_sec('train', self.learning_rate = self.get_config_from_sec('train',
'learning_rate', 1e-3) 'learning_rate', 1e-3)
...@@ -142,4 +137,3 @@ class AttentionCluster(ModelBase): ...@@ -142,4 +137,3 @@ class AttentionCluster(ModelBase):
"attention_cluster_youtube8m", "attention_cluster_youtube8m",
"https://paddlemodels.bj.bcebos.com/video_classification/attention_cluster_youtube8m.tar.gz" "https://paddlemodels.bj.bcebos.com/video_classification/attention_cluster_youtube8m.tar.gz"
) )
...@@ -37,7 +37,6 @@ class AttentionLSTM(ModelBase): ...@@ -37,7 +37,6 @@ class AttentionLSTM(ModelBase):
# get mode configs # get mode configs
self.batch_size = self.get_config_from_sec(self.mode, 'batch_size', 1) self.batch_size = self.get_config_from_sec(self.mode, 'batch_size', 1)
self.use_gpu = self.get_config_from_sec(self.mode, 'use_gpu', False)
self.gpu_num = self.get_config_from_sec(self.mode, 'gpu_num', 1) self.gpu_num = self.get_config_from_sec(self.mode, 'gpu_num', 1)
if self.mode == 'train': if self.mode == 'train':
...@@ -148,4 +147,3 @@ class AttentionLSTM(ModelBase): ...@@ -148,4 +147,3 @@ class AttentionLSTM(ModelBase):
def weights_info(self): def weights_info(self):
return (None, None) return (None, None)
python train.py --model-name="AttentionLSTM" --config=./configs/attention_lstm.txt --epoch-num=10 \ python3 train.py --model-name="AttentionLSTM" --config=./configs/attention_lstm.txt --epoch-num=10 \
--valid-interval=1 --save-interval=1 --log-interval=10 --valid-interval=1 --save-interval=1 --log-interval=10
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册