Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
OneFlow-Benchmark
提交
a349f799
O
OneFlow-Benchmark
项目概览
Oneflow-Inc
/
OneFlow-Benchmark
上一次同步 接近 3 年
通知
1
Star
92
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OneFlow-Benchmark
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a349f799
编写于
8月 31, 2020
作者:
F
Flowingsun007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replace warning function >> flow.image.Resize() with new api
上级
637bb9cd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
6 deletion
+31
-6
Classification/cnns/ofrecord_util.py
Classification/cnns/ofrecord_util.py
+7
-5
Classification/cnns/train.sh
Classification/cnns/train.sh
+24
-1
未找到文件。
Classification/cnns/ofrecord_util.py
浏览文件 @
a349f799
...
...
@@ -92,11 +92,10 @@ def load_imagenet_for_training(args):
color_space
=
color_space
)
label
=
flow
.
data
.
OFRecordRawDecoder
(
ofrecord
,
"class/label"
,
shape
=
(),
dtype
=
flow
.
int32
)
rsz
=
flow
.
image
.
Resize
(
image
,
resize_x
=
args
.
image_size
,
resize_y
=
args
.
image_size
,
color_space
=
color_space
)
rsz
=
flow
.
image
.
Resize
(
image
,
target_size
=
[
args
.
image_size
,
args
.
image_size
])
rng
=
flow
.
random
.
CoinFlip
(
batch_size
=
train_batch_size
)
# , seed=seed)
normal
=
flow
.
image
.
CropMirrorNormalize
(
rsz
,
mirror_blob
=
rng
,
color_space
=
color_space
,
normal
=
flow
.
image
.
CropMirrorNormalize
(
rsz
[
0
]
,
mirror_blob
=
rng
,
color_space
=
color_space
,
mean
=
args
.
rgb_mean
,
std
=
args
.
rgb_std
,
output_dtype
=
flow
.
float
)
return
label
,
normal
...
...
@@ -115,10 +114,13 @@ def load_imagenet_for_validation(args):
ofrecord
,
"encoded"
,
color_space
=
color_space
)
label
=
flow
.
data
.
OFRecordRawDecoder
(
ofrecord
,
"class/label"
,
shape
=
(),
dtype
=
flow
.
int32
)
rsz
=
flow
.
image
.
Resize
(
image
,
resize_shorter
=
args
.
resize_shorter
,
color_space
=
color_space
)
image
,
resize_side
=
"shorter"
,
keep_aspect_ratio
=
True
,
target_size
=
args
.
resize_shorter
)
normal
=
flow
.
image
.
CropMirrorNormalize
(
rsz
,
color_space
=
color_space
,
normal
=
flow
.
image
.
CropMirrorNormalize
(
rsz
[
0
]
,
color_space
=
color_space
,
crop_h
=
args
.
image_size
,
crop_w
=
args
.
image_size
,
crop_pos_y
=
0.5
,
crop_pos_x
=
0.5
,
mean
=
args
.
rgb_mean
,
std
=
args
.
rgb_std
,
output_dtype
=
flow
.
float
)
return
label
,
normal
...
...
Classification/cnns/train.sh
浏览文件 @
a349f799
#!/bin/sh
#!/bin/
ba
sh
rm
-rf
core.
*
rm
-rf
./output/snapshots/
*
...
...
@@ -17,6 +17,29 @@ python3 of_cnn_train_val.py \
--model
=
"resnet50"
# # training with mini-imagenet
# DATA_ROOT=data/mini-imagenet/ofrecord
# python3 of_cnn_train_val.py \
# --train_data_dir=$DATA_ROOT/train \
# --num_examples=50 \
# --train_data_part_num=1 \
# --val_data_dir=$DATA_ROOT/validation \
# --num_val_examples=50 \
# --val_data_part_num=1 \
# --num_nodes=1 \
# --gpu_num_per_node=1 \
# --model_update="momentum" \
# --learning_rate=0.001 \
# --loss_print_every_n_iter=1 \
# --batch_size_per_device=16 \
# --val_batch_size_per_device=10 \
# --num_epoch=10 \
# --model="resnet50"
# # training with imagenet
# DATA_ROOT=/datasets/ImageNet/ofrecord
# LOG_FOLDER=../logs
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录