Commit 7d300ea5 authored by Yuxin Wu's avatar Yuxin Wu

fix cifar example

parent 6eb0bebe
...@@ -12,6 +12,8 @@ from tensorpack import * ...@@ -12,6 +12,8 @@ from tensorpack import *
from tensorpack.tfutils.symbolic_functions import * from tensorpack.tfutils.symbolic_functions import *
from tensorpack.tfutils.summary import * from tensorpack.tfutils.summary import *
from tensorflow.contrib.layers import variance_scaling_initializer
""" """
CIFAR10 ResNet example. See: CIFAR10 ResNet example. See:
Deep Residual Learning for Image Recognition, arxiv:1512.03385 Deep Residual Learning for Image Recognition, arxiv:1512.03385
...@@ -69,7 +71,7 @@ class Model(ModelDesc): ...@@ -69,7 +71,7 @@ class Model(ModelDesc):
l = c2 + l l = c2 + l
return l return l
with argscope(Conv2D, nl=tf.identity, use_bias=False, kernel=3, with argscope(Conv2D, nl=tf.identity, use_bias=False, kernel_shape=3,
W_init=variance_scaling_initializer(mode='FAN_OUT')): W_init=variance_scaling_initializer(mode='FAN_OUT')):
l = Conv2D('conv0', image, 16) l = Conv2D('conv0', image, 16)
l = BatchNorm('bn0', l) l = BatchNorm('bn0', l)
...@@ -121,8 +123,6 @@ def get_data(train_or_test): ...@@ -121,8 +123,6 @@ def get_data(train_or_test):
imgaug.CenterPaste((40, 40)), imgaug.CenterPaste((40, 40)),
imgaug.RandomCrop((32, 32)), imgaug.RandomCrop((32, 32)),
imgaug.Flip(horiz=True), imgaug.Flip(horiz=True),
#imgaug.Brightness(20),
#imgaug.Contrast((0.6,1.4)),
imgaug.MapImage(lambda x: x - pp_mean), imgaug.MapImage(lambda x: x - pp_mean),
] ]
else: else:
......
Markdown is supported
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