Skip to content
Snippets Groups Projects
Unverified Commit 38058771 authored by i-robot's avatar i-robot Committed by Gitee
Browse files

!3173 densenet image_size配置选项修改

Merge pull request !3173 from 邓卓/modify-networks
parents e8d00094 4b0f8af2
No related branches found
No related tags found
No related merge requests found
......@@ -149,7 +149,7 @@ def _export_air(ckpt_dir):
param_dict = load_checkpoint(ckpt_file)
load_param_into_net(net, param_dict)
input_arr = Tensor(np.zeros([1, 3, 224, 224],
input_arr = Tensor(np.zeros([1, 3, config.image_size[0], config.image_size[1]],
np.float32))
print("Start export air.")
export(net, input_arr, file_name=config.file_name,
......
......@@ -59,7 +59,7 @@ for ((i = 0; i < ${DEVICE_NUM}; i++)); do
nohup python train.py \
--batch_size 16 \
--lr 1e-4 \
--scale 2+3+4 \
--scale 2 \
--task_id 0 \
--dir_data $PATH2 \
--epochs 500 \
......
......@@ -86,12 +86,11 @@ class Upsampler(nn.Cell):
"""rcan"""
super(Upsampler, self).__init__()
m = []
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))
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))
self.net = nn.SequentialCell(m)
def construct(self, x):
......@@ -186,7 +185,7 @@ class RCAN(nn.Cell):
n_feats = args.n_feats
kernel_size = 3
reduction = args.reduction
scale = args.scale
scale = args.scale[0]
self.dytpe = mstype.float16
# RGB mean for DIV2K
......
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