Skip to content

Commit

Permalink
PyUP - Dependency Update Scheduled daily dependency update on thursday (
Browse files Browse the repository at this point in the history
#823)

* Pin imageio to latest version 2.4.0

* Pin pytest to latest version 3.8.0

* Update requirements_test.txt

* Update requirements.txt

* Update CHANGELOG.md

* YAPF Applied

* YAPF Corrections Applied
  • Loading branch information
pyup-bot authored and Jonathan DEKHTIAR committed Sep 7, 2018
1 parent c969b68 commit 6fea9d9
Show file tree
Hide file tree
Showing 27 changed files with 87 additions and 86 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ To release a new version, please update the changelog as followed:
## [Unreleased]

### Added
- unittest `tests\test_timeout.py` has been added to ensure the network creation process does not freeze.

### Changed
- remove 'tensorboard' param, replaced by 'tensorboard_dir' in `tensorlayer/utils.py` with customizable tensorboard directory (PR #819)

### Deprecated

### Removed
- TL Graph API removed. Memory Leaks Issues with this API, will be fixed and integrated in TL 2.0 (PR #818)

### Fixed

Expand All @@ -85,11 +87,13 @@ To release a new version, please update the changelog as followed:
### Dependencies Update
- autopep8>=1.3,<1.4 => autopep8>=1.3,<1.5 (PR #815)
- pytest-cov>=2.5,<2.6 => pytest-cov>=2.5,<2.7 (PR #820)
- pytest>=3.6,<3.8 => pytest>=3.6,<3.9 (PR #823)
- imageio>=2.3,<2.4 => imageio>=2.3,<2.5 (PR #823)

### Contributors
- @DEKHTIARJonathan: #815 #818 #820 #823
- @ndiy: #819

- @DEKHTIARJonathan: #815 #820
- @zsdonghao: #818

## [1.10.0] - 2018-09-02

Expand Down
4 changes: 2 additions & 2 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
imageio>=2.3,<2.4
imageio>=2.3,<2.5
lxml>=4.2,<4.3
matplotlib>=2.2,<2.3
numpy>=1.14,<1.16
Expand All @@ -8,4 +8,4 @@ scikit-learn>=0.19,<0.20
scikit-image>=0.14,<0.15
scipy>=1.1,<1.2
tqdm>=4.23,<4.26
wrapt>=1.10,<1.11
wrapt>=1.10,<1.11
2 changes: 1 addition & 1 deletion requirements/requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
keras>=2.2,<2.3
pycodestyle>=2.0,<2.5
pydocstyle>=2.1,<2.2
pytest>=3.6,<3.8
pytest>=3.6,<3.9
pytest-cache>=1.0,<1.1
pytest-cov>=2.5,<2.7
pytest-xdist>=1.22,<1.24
Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def dice_coe(output, target, loss_type='jaccard', axis=(1, 2, 3), smooth=1e-5):
# epsilon = 1e-5
# dice = tf.clip_by_value(dice, 0, 1.0-epsilon) # if all empty, dice = 1
# new haodong
dice = (2. * inse + smooth) / (l +r+ smooth)
dice = (2. * inse + smooth) / (l + r + smooth)
##
dice = tf.reduce_mean(dice, name='dice_coe')
return dice
Expand Down Expand Up @@ -298,7 +298,7 @@ def dice_hard_coe(output, target, threshold=0.5, axis=(1, 2, 3), smooth=1e-5):
# epsilon = 1e-5
# hard_dice = tf.clip_by_value(hard_dice, 0, 1.0-epsilon)
# new haodong
hard_dice = (2. * inse + smooth) / (l +r+ smooth)
hard_dice = (2. * inse + smooth) / (l + r + smooth)
##
hard_dice = tf.reduce_mean(hard_dice, name='hard_dice')
return hard_dice
Expand Down
12 changes: 5 additions & 7 deletions tensorlayer/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,8 @@ def find_top_model(self, sess, sort=None, model_name='model', **kwargs):

pc = self.db.Model.find(kwargs)
print(
"[Database] Find one model SUCCESS. kwargs:{} sort:{} save time:{} took: {}s".format(
kwargs, sort, _datetime, round(time.time() - s, 2)
)
"[Database] Find one model SUCCESS. kwargs:{} sort:{} save time:{} took: {}s".
format(kwargs, sort, _datetime, round(time.time() - s, 2))
)

# put all informations of model into the TL layer
Expand Down Expand Up @@ -656,10 +655,9 @@ def run_top_task(self, task_name=None, sort=None, **kwargs):
}}, return_document=pymongo.ReturnDocument.AFTER
)
logging.info(
"[Database] Finished Task: task_name - {} sort: {} push time: {} took: {}s".format(
task_name, sort, _datetime,
time.time() - s
)
"[Database] Finished Task: task_name - {} sort: {} push time: {} took: {}s".
format(task_name, sort, _datetime,
time.time() - s)
)
return True
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/decorators/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def wrapper(wrapped, instance=None, args=None, kwargs=None):
'%s: `%s.%s` (in file: %s) is deprecated and will be removed %s.\n'
'Instructions for updating: %s\n' % (
"Class" if inspect.isclass(wrapped) else "Function", wrapped.__module__, class_or_func_name,
wrapped.__code__.co_filename, 'in a future version'
if date is None else ('after %s' % date), instructions
wrapped.__code__.co_filename, 'in a future version' if date is None else
('after %s' % date), instructions
)
)

Expand Down
6 changes: 3 additions & 3 deletions tensorlayer/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ def create_task_spec_def():
task_data = env.get('task', None) or {'type': 'master', 'index': 0}
cluster_data = env.get('cluster', None) or {'ps': None, 'worker': None, 'master': None}
return TaskSpecDef(
task_type=task_data['type'], index=task_data['index'], trial=task_data['trial'] if 'trial' in task_data else
None, ps_hosts=cluster_data['ps'], worker_hosts=cluster_data['worker'], master=cluster_data['master']
if 'master' in cluster_data else None
task_type=task_data['type'], index=task_data['index'],
trial=task_data['trial'] if 'trial' in task_data else None, ps_hosts=cluster_data['ps'],
worker_hosts=cluster_data['worker'], master=cluster_data['master'] if 'master' in cluster_data else None
)
elif 'JOB_NAME' in os.environ:
# JOB_NAME, TASK_INDEX, PS_HOSTS, WORKER_HOSTS and MASTER_HOST are used in TensorPort
Expand Down
2 changes: 1 addition & 1 deletion tensorlayer/files/dataset_loaders/mpii_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def save_joints():
vis = None

# if len(joint_pos) == 16:
if ((is_16_pos_only == True) and (len(joint_pos) == 16)) or (is_16_pos_only == False):
if ((is_16_pos_only ==True) and (len(joint_pos) == 16)) or (is_16_pos_only == False):
# only use image with 16 key points / or use all
data = {
'filename': img_fn,
Expand Down
2 changes: 1 addition & 1 deletion tensorlayer/files/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ def save_joints():
vis = None

# if len(joint_pos) == 16:
if ((is_16_pos_only == True) and (len(joint_pos) == 16)) or (is_16_pos_only == False):
if ((is_16_pos_only ==True) and (len(joint_pos) == 16)) or (is_16_pos_only == False):
# only use image with 16 key points / or use all
data = {
'filename': img_fn,
Expand Down
2 changes: 1 addition & 1 deletion tensorlayer/iterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def minibatches(inputs=None, targets=None, batch_size=None, allow_dynamic_batch_
excerpt = indices[start_idx:end_idx]
else:
excerpt = slice(start_idx, end_idx)
if (isinstance(inputs, list) or isinstance(targets, list)) and (shuffle == True):
if (isinstance(inputs, list) or isinstance(targets, list)) and (shuffle ==True):
# zsdonghao: for list indexing when shuffle==True
yield [inputs[i] for i in excerpt], [targets[i] for i in excerpt]
else:
Expand Down
8 changes: 4 additions & 4 deletions tensorlayer/layers/convolution/atrous_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def __init__(

logging.info(
"AtrousConv2dLayer %s: n_filter: %d filter_size: %s rate: %d pad: %s act: %s" % (
self.name, n_filter, filter_size, rate, padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, filter_size, rate, padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down Expand Up @@ -209,8 +209,8 @@ def __init__(

logging.info(
"AtrousDeConv2dLayer %s: shape: %s output_shape: %s rate: %d pad: %s act: %s" % (
self.name, shape, output_shape, rate, padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, shape, output_shape, rate, padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/layers/convolution/binary_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def __init__(

logging.info(
"BinaryConv2d %s: n_filter: %d filter_size: %s strides: %s pad: %s act: %s" % (
self.name, n_filter, str(filter_size), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, str(filter_size), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/layers/convolution/depthwise_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def __init__(

logging.info(
"DepthwiseConv2d %s: shape: %s strides: %s pad: %s act: %s" % (
self.name, str(shape), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, str(shape), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/layers/convolution/dorefa_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def __init__(

logging.info(
"DorefaConv2d %s: n_filter: %d filter_size: %s strides: %s pad: %s act: %s" % (
self.name, n_filter, str(filter_size), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, str(filter_size), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
12 changes: 6 additions & 6 deletions tensorlayer/layers/convolution/expert_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def __init__(

logging.info(
"Conv1dLayer %s: shape: %s stride: %s pad: %s act: %s" % (
self.name, str(shape), str(stride), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, str(shape), str(stride), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down Expand Up @@ -193,8 +193,8 @@ def __init__(

logging.info(
"Conv2dLayer %s: shape: %s strides: %s pad: %s act: %s" % (
self.name, str(shape), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, str(shape), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down Expand Up @@ -281,8 +281,8 @@ def __init__(

logging.info(
"Conv3dLayer %s: shape: %s strides: %s pad: %s act: %s" % (
self.name, str(shape), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, str(shape), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
8 changes: 4 additions & 4 deletions tensorlayer/layers/convolution/expert_deconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def __init__(

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, self.act.__name__
if self.act is not None else 'No Activation'
self.name, str(shape), str(output_shape), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down Expand Up @@ -196,8 +196,8 @@ def __init__(

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, self.act.__name__
if self.act is not None else 'No Activation'
self.name, str(shape), str(output_shape), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/layers/convolution/group_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def __init__(

logging.info(
"GroupConv2d %s: n_filter: %d size: %s strides: %s n_group: %d pad: %s act: %s" % (
self.name, n_filter, str(filter_size), str(strides), n_group, padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, str(filter_size), str(strides), n_group, padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/layers/convolution/quan_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def __init__(

logging.info(
"QuanConv2d %s: n_filter: %d filter_size: %s strides: %s pad: %s act: %s" % (
self.name, n_filter, str(filter_size), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, str(filter_size), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/layers/convolution/quan_conv_bn.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def __init__(

logging.info(
"QuanConv2dWithBN %s: n_filter: %d filter_size: %s strides: %s pad: %s act: %s " % (
self.name, n_filter, filter_size, str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, filter_size, str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
8 changes: 4 additions & 4 deletions tensorlayer/layers/convolution/separable_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def __init__(

logging.info(
"SeparableConv1d %s: n_filter: %d filter_size: %s filter_size: %s depth_multiplier: %d act: %s" % (
self.name, n_filter, str(filter_size), str(strides), depth_multiplier, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, str(filter_size), str(strides), depth_multiplier,
self.act.__name__ if self.act is not None else 'No Activation'
)
)
# with tf.variable_scope(name) as vs:
Expand Down Expand Up @@ -196,8 +196,8 @@ def __init__(

logging.info(
"SeparableConv2d %s: n_filter: %d filter_size: %s filter_size: %s depth_multiplier: %d act: %s" % (
self.name, n_filter, str(filter_size), str(strides), depth_multiplier, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, str(filter_size), str(strides), depth_multiplier,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
8 changes: 4 additions & 4 deletions tensorlayer/layers/convolution/simplified_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def __init__(

logging.info(
"Conv1d %s: n_filter: %d filter_size: %s stride: %d pad: %s act: %s dilation_rate: %d" % (
self.name, n_filter, filter_size, stride, padding, self.act.__name__
if self.act is not None else 'No Activation', dilation_rate
self.name, n_filter, filter_size, stride, padding,
self.act.__name__ if self.act is not None else 'No Activation', dilation_rate
)
)

Expand Down Expand Up @@ -183,8 +183,8 @@ def __init__(

logging.info(
"Conv2d %s: n_filter: %d filter_size: %s strides: %s pad: %s act: %s" % (
self.name, n_filter, str(filter_size), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, str(filter_size), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)
# with tf.variable_scope(name) as vs:
Expand Down
8 changes: 4 additions & 4 deletions tensorlayer/layers/convolution/simplified_deconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def __init__(

logging.info(
"DeConv2d %s: n_filters: %s strides: %s pad: %s act: %s" % (
self.name, str(n_filter), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, str(n_filter), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down Expand Up @@ -149,8 +149,8 @@ def __init__(

logging.info(
"DeConv3d %s: n_filters: %s strides: %s pad: %s act: %s" % (
self.name, str(n_filter), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, str(n_filter), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
4 changes: 2 additions & 2 deletions tensorlayer/layers/convolution/ternary_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def __init__(

logging.info(
"TernaryConv2d %s: n_filter: %d filter_size: %s strides: %s pad: %s act: %s" % (
self.name, n_filter, str(filter_size), str(strides), padding, self.act.__name__
if self.act is not None else 'No Activation'
self.name, n_filter, str(filter_size), str(strides), padding,
self.act.__name__ if self.act is not None else 'No Activation'
)
)

Expand Down
5 changes: 2 additions & 3 deletions tensorlayer/layers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,8 @@ def print_params(self, details=True, session=None):
try:
val = p.eval(session=session)
logging.info(
" param {:3}: {:20} {:15} {} (mean: {:<18}, median: {:<18}, std: {:<18}) ".format(
i, p.name, str(val.shape), p.dtype.name, val.mean(), np.median(val), val.std()
)
" param {:3}: {:20} {:15} {} (mean: {:<18}, median: {:<18}, std: {:<18}) ".
format(i, p.name, str(val.shape), p.dtype.name, val.mean(), np.median(val), val.std())
)
except Exception as e:
logging.info(str(e))
Expand Down
6 changes: 3 additions & 3 deletions tensorlayer/layers/recurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1622,9 +1622,9 @@ def __init__(
network_decode = DynamicRNNLayer(
net_decode_in, cell_fn=cell_fn, cell_init_args=self.cell_init_args, n_hidden=n_hidden,
initializer=initializer,
initial_state=(network_encode.final_state if initial_state_decode is None else
initial_state_decode), dropout=dropout, n_layer=n_layer,
sequence_length=decode_sequence_length, return_last=False, return_seq_2d=return_seq_2d, name='decode'
initial_state=(network_encode.final_state if initial_state_decode is None else initial_state_decode),
dropout=dropout, n_layer=n_layer, sequence_length=decode_sequence_length, return_last=False,
return_seq_2d=return_seq_2d, name='decode'
)
self.outputs = network_decode.outputs

Expand Down
Loading

0 comments on commit 6fea9d9

Please sign in to comment.