|
|
|
@ -6,8 +6,15 @@ width = 224
|
|
|
|
|
num_class = 1000
|
|
|
|
|
batch_size = get_config_arg('batch_size', int, 128)
|
|
|
|
|
use_gpu = get_config_arg('use_gpu', bool, True)
|
|
|
|
|
|
|
|
|
|
args = {'height': height, 'width': width, 'color': True, 'num_class': num_class}
|
|
|
|
|
is_infer = get_config_arg("is_infer", bool, False)
|
|
|
|
|
|
|
|
|
|
args = {
|
|
|
|
|
'height': height,
|
|
|
|
|
'width': width,
|
|
|
|
|
'color': True,
|
|
|
|
|
'num_class': num_class,
|
|
|
|
|
'is_infer': is_infer
|
|
|
|
|
}
|
|
|
|
|
define_py_data_sources2(
|
|
|
|
|
"train.list", "test.list", module="provider", obj="process", args=args)
|
|
|
|
|
|
|
|
|
@ -146,7 +153,6 @@ def inception(name, input, channels, \
|
|
|
|
|
return cat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lab = data_layer(name="label", size=1000)
|
|
|
|
|
data = data_layer(name="input", size=3 * height * width)
|
|
|
|
|
|
|
|
|
|
# stage 1
|
|
|
|
@ -224,6 +230,10 @@ pool5 = img_pool_layer(
|
|
|
|
|
dropout = dropout_layer(name="dropout", input=pool5, dropout_rate=0.4)
|
|
|
|
|
out3 = fc_layer(
|
|
|
|
|
name="output3", input=dropout, size=1000, act=SoftmaxActivation())
|
|
|
|
|
loss3 = cross_entropy(name='loss3', input=out3, label=lab)
|
|
|
|
|
|
|
|
|
|
if is_infer:
|
|
|
|
|
outputs(out3)
|
|
|
|
|
else:
|
|
|
|
|
lab = data_layer(name="label", size=num_class)
|
|
|
|
|
loss3 = cross_entropy(name='loss3', input=out3, label=lab)
|
|
|
|
|
outputs(loss3)
|
|
|
|
|