@@ -54,7 +54,7 @@ def __init__(
54
54
):
55
55
Layer .__init__ (self , name = name )
56
56
self .inputs = layer .outputs
57
- print ( " [TL] Conv1dLayer %s: shape:%s stride:%s pad:%s act:%s" % (self .name , str (shape ), str (stride ), padding , act .__name__ ))
57
+ logging . info ( " Conv1dLayer %s: shape:%s stride:%s pad:%s act:%s" % (self .name , str (shape ), str (stride ), padding , act .__name__ ))
58
58
if act is None :
59
59
act = tf .identity
60
60
with tf .variable_scope (name ) as vs :
@@ -158,7 +158,7 @@ def __init__(
158
158
):
159
159
Layer .__init__ (self , name = name )
160
160
self .inputs = layer .outputs
161
- print ( " [TL] Conv2dLayer %s: shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (strides ), padding , act .__name__ ))
161
+ logging . info ( " Conv2dLayer %s: shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (strides ), padding , act .__name__ ))
162
162
163
163
with tf .variable_scope (name ) as vs :
164
164
W = tf .get_variable (name = 'W_conv2d' , shape = shape , initializer = W_init , dtype = D_TYPE , ** W_init_args )
@@ -267,9 +267,9 @@ def __init__(
267
267
):
268
268
Layer .__init__ (self , name = name )
269
269
self .inputs = layer .outputs
270
- print ( " [TL] DeConv2dLayer %s: shape:%s out_shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (output_shape ), str (strides ), padding ,
270
+ logging . info ( " DeConv2dLayer %s: shape:%s out_shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (output_shape ), str (strides ), padding ,
271
271
act .__name__ ))
272
- # print (" DeConv2dLayer: Untested")
272
+ # logging.info (" DeConv2dLayer: Untested")
273
273
with tf .variable_scope (name ) as vs :
274
274
W = tf .get_variable (name = 'W_deconv2d' , shape = shape , initializer = W_init , dtype = D_TYPE , ** W_init_args )
275
275
if b_init :
@@ -331,7 +331,7 @@ def __init__(
331
331
):
332
332
Layer .__init__ (self , name = name )
333
333
self .inputs = layer .outputs
334
- print ( " [TL] Conv3dLayer %s: shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (strides ), padding , act .__name__ ))
334
+ logging . info ( " Conv3dLayer %s: shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (strides ), padding , act .__name__ ))
335
335
336
336
with tf .variable_scope (name ) as vs :
337
337
# W = tf.Variable(W_init(shape=shape, **W_init_args), name='W_conv')
@@ -394,7 +394,7 @@ def __init__(
394
394
):
395
395
Layer .__init__ (self , name = name )
396
396
self .inputs = layer .outputs
397
- print ( " [TL] DeConv3dLayer %s: shape:%s out_shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (output_shape ), str (strides ), padding ,
397
+ logging . info ( " DeConv3dLayer %s: shape:%s out_shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (output_shape ), str (strides ), padding ,
398
398
act .__name__ ))
399
399
400
400
with tf .variable_scope (name ) as vs :
@@ -452,7 +452,7 @@ def __init__(
452
452
size = [int (size_h ), int (size_w )]
453
453
else :
454
454
raise Exception ("Donot support shape %s" % self .inputs .get_shape ())
455
- print ( " [TL] UpSampling2dLayer %s: is_scale:%s size:%s method:%d align_corners:%s" % (name , is_scale , size , method , align_corners ))
455
+ logging . info ( " UpSampling2dLayer %s: is_scale:%s size:%s method:%d align_corners:%s" % (name , is_scale , size , method , align_corners ))
456
456
with tf .variable_scope (name ) as vs :
457
457
try :
458
458
self .outputs = tf .image .resize_images (self .inputs , size = size , method = method , align_corners = align_corners )
@@ -507,7 +507,7 @@ def __init__(
507
507
size = [int (size_h ), int (size_w )]
508
508
else :
509
509
raise Exception ("Donot support shape %s" % self .inputs .get_shape ())
510
- print ( " [TL] DownSampling2dLayer %s: is_scale:%s size:%s method:%d, align_corners:%s" % (name , is_scale , size , method , align_corners ))
510
+ logging . info ( " DownSampling2dLayer %s: is_scale:%s size:%s method:%d, align_corners:%s" % (name , is_scale , size , method , align_corners ))
511
511
with tf .variable_scope (name ) as vs :
512
512
try :
513
513
self .outputs = tf .image .resize_images (self .inputs , size = size , method = method , align_corners = align_corners )
@@ -699,7 +699,7 @@ def __init__(self,
699
699
self .inputs = layer .outputs
700
700
self .offset_layer = offset_layer
701
701
702
- print ( " [TL] DeformableConv2dLayer %s: shape:%s, act:%s" % (self .name , str (shape ), act .__name__ ))
702
+ logging . info ( " DeformableConv2dLayer %s: shape:%s, act:%s" % (self .name , str (shape ), act .__name__ ))
703
703
704
704
with tf .variable_scope (name ) as vs :
705
705
offset = self .offset_layer .outputs
@@ -836,7 +836,7 @@ def __init__(self,
836
836
self .inputs = layer .outputs
837
837
if act is None :
838
838
act = tf .identity
839
- print ( " [TL] AtrousConv2dLayer %s: n_filter:%d filter_size:%s rate:%d pad:%s act:%s" % (self .name , n_filter , filter_size , rate , padding , act .__name__ ))
839
+ logging . info ( " AtrousConv2dLayer %s: n_filter:%d filter_size:%s rate:%d pad:%s act:%s" % (self .name , n_filter , filter_size , rate , padding , act .__name__ ))
840
840
with tf .variable_scope (name ) as vs :
841
841
shape = [filter_size [0 ], filter_size [1 ], int (self .inputs .get_shape ()[- 1 ]), n_filter ]
842
842
filters = tf .get_variable (name = 'filter' , shape = shape , initializer = W_init , dtype = D_TYPE , ** W_init_args )
@@ -909,8 +909,8 @@ def __init__(self,
909
909
910
910
bias_initializer = bias_initializer ()
911
911
912
- print ( " [TL] SeparableConv2dLayer %s: filters:%s kernel_size:%s strides:%s padding:%s dilation_rate:%s depth_multiplier:%s act:%s" %
913
- (self .name , str (filters ), str (kernel_size ), str (strides ), padding , str (dilation_rate ), str (depth_multiplier ), act .__name__ ))
912
+ logging . info ( " SeparableConv2dLayer %s: filters:%s kernel_size:%s strides:%s padding:%s dilation_rate:%s depth_multiplier:%s act:%s" %
913
+ (self .name , str (filters ), str (kernel_size ), str (strides ), padding , str (dilation_rate ), str (depth_multiplier ), act .__name__ ))
914
914
915
915
with tf .variable_scope (name ) as vs :
916
916
self .outputs = tf .layers .separable_conv2d (
@@ -1116,7 +1116,7 @@ def conv2d(
1116
1116
pre_channel = int (net .outputs .get_shape ()[- 1 ])
1117
1117
except : # if pre_channel is ?, it happens when using Spatial Transformer Net
1118
1118
pre_channel = 1
1119
- print ("[warnings] unknow input channels, set to 1" )
1119
+ logging . info ("[warnings] unknow input channels, set to 1" )
1120
1120
net = Conv2dLayer (
1121
1121
net ,
1122
1122
act = act ,
@@ -1169,7 +1169,7 @@ def deconv2d(net,
1169
1169
act = tf .identity
1170
1170
1171
1171
if tf .__version__ > '1.3' :
1172
- print ( " [TL] DeConv2d %s: n_filters:%s strides:%s pad:%s act:%s" % (name , str (n_filter ), str (strides ), padding , act .__name__ ))
1172
+ logging . info ( " DeConv2d %s: n_filters:%s strides:%s pad:%s act:%s" % (name , str (n_filter ), str (strides ), padding , act .__name__ ))
1173
1173
inputs = net .outputs
1174
1174
scope_name = tf .get_variable_scope ().name
1175
1175
if scope_name :
@@ -1256,7 +1256,7 @@ def __init__(self,
1256
1256
if act is None :
1257
1257
act = tf .identity
1258
1258
1259
- print ( " [TL] DeConv3d %s: n_filters:%s strides:%s pad:%s act:%s" % (name , str (n_filter ), str (strides ), padding , act .__name__ ))
1259
+ logging . info ( " DeConv3d %s: n_filters:%s strides:%s pad:%s act:%s" % (name , str (n_filter ), str (strides ), padding , act .__name__ ))
1260
1260
1261
1261
with tf .variable_scope (name ) as vs :
1262
1262
self .outputs = tf .contrib .layers .conv3d_transpose (
@@ -1341,7 +1341,7 @@ def __init__(
1341
1341
if act is None :
1342
1342
act = tf .identity
1343
1343
1344
- print ( " [TL] DepthwiseConv2d %s: shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (strides ), padding , act .__name__ ))
1344
+ logging . info ( " DepthwiseConv2d %s: shape:%s strides:%s pad:%s act:%s" % (self .name , str (shape ), str (strides ), padding , act .__name__ ))
1345
1345
1346
1346
if act is None :
1347
1347
act = tf .identity
@@ -1350,7 +1350,7 @@ def __init__(
1350
1350
pre_channel = int (layer .outputs .get_shape ()[- 1 ])
1351
1351
except : # if pre_channel is ?, it happens when using Spatial Transformer Net
1352
1352
pre_channel = 1
1353
- print ("[warnings] unknow input channels, set to 1" )
1353
+ logging . info ("[warnings] unknow input channels, set to 1" )
1354
1354
1355
1355
shape = [shape [0 ], shape [1 ], pre_channel , channel_multiplier ]
1356
1356
0 commit comments