diff --git a/tensorlayer/layers.py b/tensorlayer/layers.py index 101141f89..f3e49f058 100644 --- a/tensorlayer/layers.py +++ b/tensorlayer/layers.py @@ -1888,10 +1888,10 @@ def __init__( Layer.__init__(self, name=name) self.inputs = layer.outputs self.offset_layer = offset_layer - + if tf.__version__ < "1.4": raise Exception("Deformable CNN layer requires tensrflow 1.4 or higher version") - + print(" [TL] DeformableConv2dLayer %s: shape:%s, act:%s" % (self.name, str(shape), act.__name__)) @@ -2525,7 +2525,7 @@ def __init__( if len(strides) == 2: strides = [1, strides[0], strides[1], 1] - assert len(strides) == 4, "len(strides) should be 4." + assert len(strides) == 4, "len(strides) should be 4." with tf.variable_scope(name) as vs: W = tf.get_variable(name='W_sepconv2d', shape=shape, initializer=W_init, **W_init_args ) # [filter_height, filter_width, in_channels, channel_multiplier] @@ -2546,8 +2546,8 @@ def __init__( ## Super resolution def SubpixelConv2d(net, scale=2, n_out_channel=None, act=tf.identity, name='subpixel_conv2d'): - """The :class:`SubpixelConv2d` class is a sub-pixel 2d convolutional ayer, usually be used - for Super-Resolution applications, `example code `_. + """It is a sub-pixel 2d upsampling layer, usually be used + for Super-Resolution applications, see `example code `_. Parameters ------------ @@ -2636,7 +2636,7 @@ def _PS(X, r, n_out_channel): return net_new def SubpixelConv2d_old(net, scale=2, n_out_channel=None, act=tf.identity, name='subpixel_conv2d'): - """The :class:`SubpixelConv2d` class is a sub-pixel 2d convolutional ayer, usually be used + """It is a sub-pixel 2d upsampling layer, usually be used for Super-Resolution applications, `example code `_. Parameters @@ -4924,7 +4924,7 @@ def __init__( print(" non specified batch_size, uses a tensor instead.") self.batch_size = batch_size - + outputs = [] self.cell = cell = cell_fn(shape=cell_shape, filter_size=filter_size, num_features=feature_map) if initial_state is None: diff --git a/tensorlayer/prepro.py b/tensorlayer/prepro.py index 3ed6287c4..29ffcb31c 100644 --- a/tensorlayer/prepro.py +++ b/tensorlayer/prepro.py @@ -751,7 +751,7 @@ def zoom(x, zoom_range=(0.9, 1.1), is_random=False, row_index=0, col_index=1, ch An image with dimension of [row, col, channel] (default). zoom_range : list or tuple - If is_random=False, (h, w) are the fixed zoom factor for row and column axies, factor small than one is zoom in. - - If is_random=True, (min zoom out, max zoom out) for x and y with different random zoom in/out factor. + - If is_random=True, it is (min zoom out, max zoom out) for x and y with different random zoom in/out factor. e.g (0.5, 1) zoom in 1~2 times. is_random : boolean, default False If True, randomly zoom. @@ -2005,7 +2005,7 @@ def obj_box_zoom(im, classes=[], coords=[], zoom_range=(0.9, 1.1), An image with dimension of [row, col, channel] (default). classes : list of class ID (int). coords : list of list for coordinates [[x, y, w, h], [x, y, w, h], ...] - zoom_range, row_index, col_index, channel_index, is_random, fill_mode, cval, order : see ``tl.prepro.shift``. + zoom_range, row_index, col_index, channel_index, is_random, fill_mode, cval, order : see ``tl.prepro.zoom``. is_rescale : boolean, default False Set to True, if the coordinates are rescaled to [0, 1]. is_center : boolean, default False