Skip to content
Snippets Groups Projects
Commit 06b4de43 authored by yuxiaodianyu's avatar yuxiaodianyu
Browse files

modify network RCAN scripts and resnet readme

parent 8f737375
No related branches found
No related tags found
No related merge requests found
......@@ -453,16 +453,20 @@ bash run_parameter_server_train_gpu.sh [DATASET_PATH] [CONFIG_PATH] [PRETRAINED_
```bash
# Ascend 分布式训练时推理示例:
cd scripts/
bash run_distribute_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [CONFIG_PATH] [RUN_EVAL](optional) [EVAL_DATASET_PATH](optional)
# Ascend 单机训练时推理示例:
bash run_standalone_train.sh [RANK_TABLE_FILE] [DATASET_PATH] [CONFIG_PATH] [RUN_EVAL](optional) [EVAL_DATASET_PATH](optional)
cd scripts/
bash run_standalone_train.sh [DATASET_PATH] [CONFIG_PATH] [RUN_EVAL](optional) [EVAL_DATASET_PATH](optional)
# GPU 分布式训练时推理示例:
bash run_distribute_train_gpu.sh [CONFIG_PATH] [RUN_EVAL](optional) [EVAL_DATASET_PATH](optional)
cd scripts/
bash run_distribute_train_gpu.sh [DATASET_PATH] [CONFIG_PATH] [RUN_EVAL](optional) [EVAL_DATASET_PATH](optional)
# GPU 单机训练时推理示例:
bash run_standalone_train_gpu.sh [CONFIG_PATH] [RUN_EVAL](optional) [EVAL_DATASET_PATH](optional)
cd scripts/
bash run_standalone_train_gpu.sh [DATASET_PATH] [CONFIG_PATH] [RUN_EVAL](optional) [EVAL_DATASET_PATH](optional)
```
训练时推理需要在设置`RUN_EVAL`为True,与此同时还需要设置`EVAL_DATASET_PATH`。此外,当设置`RUN_EVAL`为True时还可为python脚本设置`save_best_ckpt`, `eval_start_epoch`, `eval_interval`等参数。
......
......@@ -86,11 +86,12 @@ class Upsampler(nn.Cell):
"""rcan"""
super(Upsampler, self).__init__()
m = []
if (scale & (scale - 1)) == 0:
for _ in range(int(math.log(scale, 2))):
m.append(SmallUpSampler(conv, 2, n_feats, has_bias=has_bias))
elif scale == 3:
m.append(SmallUpSampler(conv, 3, n_feats, has_bias=has_bias))
for s in scale:
if (s & (s - 1)) == 0:
for _ in range(int(math.log(s, 2))):
m.append(SmallUpSampler(conv, 2, n_feats, has_bias=has_bias))
elif s == 3:
m.append(SmallUpSampler(conv, 3, n_feats, has_bias=has_bias))
self.net = nn.SequentialCell(m)
def construct(self, x):
......
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