Skip to content

Commit 4863477

Browse files
authored
Merge branch 'master' into quantized_tutorial
2 parents 423feb3 + f8930b1 commit 4863477

File tree

215 files changed

+5984
-1567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+5984
-1567
lines changed

CHANGELOG.md

+33-12
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ To release a new version, please update the changelog as followed:
6767

6868
<!-- YOU CAN EDIT FROM HERE -->
6969

70-
7170
## [Unreleased]
7271

7372
### Added
@@ -80,17 +79,38 @@ To release a new version, please update the changelog as followed:
8079

8180
### Fixed
8281

83-
- Fix README. (#PR 1044)
84-
- Fix package info. (#PR 1046)
85-
8682
### Removed
8783

8884
### Security
8985

9086
### Contributors
9187

92-
- @luomai (PR #1044, 1046)
88+
## [2.2.1] - 2020-01-14
89+
90+
TensorLayer 2.2.1 is a maintenance release.
91+
It contains numerous bug fixes.
92+
93+
### Added
94+
95+
### Changed
96+
97+
### Dependencies Update
98+
99+
### Deprecated
100+
101+
### Fixed
102+
103+
- Fix README. (#1044)
104+
- Fix package info. (#1046)
105+
- Fix build test (Using YAPF 0.29) (#1057)
106+
107+
### Removed
108+
109+
### Security
110+
111+
### Contributors
93112

113+
- @luomai (#1044, #1046, #1057)
94114

95115
## [2.2.0] - 2019-09-13
96116

@@ -150,7 +170,7 @@ This release is compatible with TensorFlow 2 RC1.
150170
- Replace tf.nn.func with tf.nn.func.\_\_name\_\_ in model config. (PR #994)
151171
- Add Reinforcement learning tutorials. (PR #995)
152172
- Add RNN layers with simple rnn cell, GRU cell, LSTM cell. (PR #998)
153-
- Update Seq2seq (#998)
173+
- Update Seq2seq (#998)
154174
- Add Seq2seqLuongAttention model (#998)
155175

156176
### Fixed
@@ -571,12 +591,13 @@ To many PR for this update, please check [here](https://github.com/tensorlayer/t
571591
@zsdonghao @luomai @DEKHTIARJonathan
572592

573593
[Unreleased]: https://github.com/tensorlayer/tensorlayer/compare/2.0....master
574-
[2.2.0]: https://github.com/tensorlayer/tensorlayer/compare/2.2.0...2.2.0
575-
[2.1.0]: https://github.com/tensorlayer/tensorlayer/compare/2.1.0...2.1.0
576-
[2.0.2]: https://github.com/tensorlayer/tensorlayer/compare/2.0.2...2.0.2
577-
[2.0.1]: https://github.com/tensorlayer/tensorlayer/compare/2.0.1...2.0.1
578-
[2.0.0]: https://github.com/tensorlayer/tensorlayer/compare/2.0.0...2.0.0
579-
[1.11.1]: https://github.com/tensorlayer/tensorlayer/compare/1.11.0...1.11.0
594+
[2.2.1]: https://github.com/tensorlayer/tensorlayer/compare/2.2.0...2.2.1
595+
[2.2.0]: https://github.com/tensorlayer/tensorlayer/compare/2.1.0...2.2.0
596+
[2.1.0]: https://github.com/tensorlayer/tensorlayer/compare/2.0.2...2.1.0
597+
[2.0.2]: https://github.com/tensorlayer/tensorlayer/compare/2.0.1...2.0.2
598+
[2.0.1]: https://github.com/tensorlayer/tensorlayer/compare/2.0.0...2.0.1
599+
[2.0.0]: https://github.com/tensorlayer/tensorlayer/compare/1.11.1...2.0.0
600+
[1.11.1]: https://github.com/tensorlayer/tensorlayer/compare/1.11.0...1.11.1
580601
[1.11.0]: https://github.com/tensorlayer/tensorlayer/compare/1.10.1...1.11.0
581602
[1.10.1]: https://github.com/tensorlayer/tensorlayer/compare/1.10.0...1.10.1
582603
[1.10.0]: https://github.com/tensorlayer/tensorlayer/compare/1.9.1...1.10.0

Makefile

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ test:
1414
python3 tests/files/test_utils_saveload.py
1515

1616
format:
17-
autoflake -i examples/*.py
18-
autoflake -i tensorlayer/*.py
19-
autoflake -i tensorlayer/**/*.py
17+
autoflake -ir examples
18+
autoflake -ir tensorlayer
19+
autoflake -ir tests
2020

2121
isort -rc examples
2222
isort -rc tensorlayer
23+
isort -rc tests
2324

24-
yapf -i examples/*.py
25-
yapf -i tensorlayer/*.py
26-
yapf -i tensorlayer/**/*.py
25+
yapf -ir examples
26+
yapf -ir tensorlayer
27+
yapf -ir tests
2728

2829
install3:
2930
pip3 install -U . --user

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<!--- [![Documentation Status](https://readthedocs.org/projects/tensorlayercn/badge/)](https://tensorlayercn.readthedocs.io/)
2121
<!--- [![PyUP Updates](https://pyup.io/repos/github/tensorlayer/tensorlayer/shield.svg)](https://pyup.io/repos/github/tensorlayer/tensorlayer/) --->
2222

23-
TensorLayer is a novel TensorFlow-based deep learning and reinforcement learning library designed for researchers and engineers. It provides an extensive collection of customizable neural layers to build complex AI models. TensorLayer is awarded the 2017 Best Open Source Software by the [ACM Multimedia Society](https://twitter.com/ImperialDSI/status/923928895325442049).
23+
[TensorLayer](https://tensorlayer.readthedocs.io) is a novel TensorFlow-based deep learning and reinforcement learning library designed for researchers and engineers. It provides an extensive collection of customizable neural layers to build complex AI models. TensorLayer is awarded the 2017 Best Open Source Software by the [ACM Multimedia Society](https://twitter.com/ImperialDSI/status/923928895325442049).
2424
TensorLayer can also be found at [iHub](https://code.ihub.org.cn/projects/328) and [Gitee](https://gitee.com/organizations/TensorLayer).
2525

2626
# News
@@ -158,7 +158,7 @@ We suggest users to report bugs using Github issues. Users can also discuss how
158158

159159
<br/>
160160

161-
<a href="https://join.slack.com/t/tensorlayer/shared_invite/enQtMjUyMjczMzU2Njg4LWI0MWU0MDFkOWY2YjQ4YjVhMzI5M2VlZmE4YTNhNGY1NjZhMzUwMmQ2MTc0YWRjMjQzMjdjMTg2MWQ2ZWJhYzc" target="\_blank">
161+
<a href="https://join.slack.com/t/tensorlayer/shared_invite/enQtODk1NTQ5NTY1OTM5LTQyMGZhN2UzZDBhM2I3YjYzZDBkNGExYzcyZDNmOGQzNmYzNjc3ZjE3MzhiMjlkMmNiMmM3Nzc4ZDY2YmNkMTY" target="\_blank">
162162
<div align="center">
163163
<img src="img/join_slack.png" width="40%"/>
164164
</div>
@@ -178,4 +178,4 @@ If you find TensorLayer useful for your project, please cite the following paper
178178
url = {http://tensorlayer.org},
179179
year = {2017}
180180
}
181-
```
181+
```

docs/user/get_involved.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ Ph.D. Postition @ PKU
99

1010

1111
Hi, I am `Hao Dong <https://zsdonghao.github.io/>`__, the founder of this project and a new faculty member in EECS, Peking University. I now have a few Ph.D. positions per year open for international students who would like to study AI. If you or your friends are interested in it, feel free to contact me.
12-
PKU is a top 30 university in the global ranking. The application is competitive, apply early is recommended. For the application of next year, please note that the DDL of Chinese Government Scholarship is in the end of each year, please check this `link <http://www.isd.pku.edu.cn/info/1503/5676.htm>`__ for more details.
12+
PKU is a top 30 university in the global ranking. The application is competitive, apply early is recommended. Please check the following links for more details.
1313

14-
My homepage: `https://zsdonghao.github.io <https://zsdonghao.github.io/>`__
14+
- `About the International Elite Ph.D. Program in Computer Science <https://cs.pku.edu.cn/info/1115/2233.htm>`__
15+
- `My homepage <https://zsdonghao.github.io/>`__
1516

1617
Contact: hao.dong [AT] pku.edu.cn
1718

docs/user/installation.rst

+11-9
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ For stable version:
3535
.. code-block:: bash
3636
3737
pip3 install tensorlayer
38+
39+
pip install tensorlayer -i https://pypi.tuna.tsinghua.edu.cn/simple (faster in China)
3840
3941
For latest version, please install from Github.
4042

@@ -60,7 +62,7 @@ Alternatively, you can build from the source.
6062
cd tensorlayer
6163
6264
# Install virtualenv if necessary
63-
pip install virtualenv
65+
sudo pip3 install virtualenv
6466
# Then create a virtualenv called `venv`
6567
virtualenv venv
6668
@@ -73,29 +75,29 @@ Alternatively, you can build from the source.
7375
venv\Scripts\activate.bat
7476
7577
# basic installation
76-
pip install .
78+
pip3 install .
7779
7880
# ============= IF TENSORFLOW IS NOT ALREADY INSTALLED ============= #
7981
8082
# for a machine **without** an NVIDIA GPU
81-
pip install -e ".[all_cpu_dev]"
83+
pip3 install -e ".[all_cpu_dev]"
8284
8385
# for a machine **with** an NVIDIA GPU
84-
pip install -e ".[all_gpu_dev]"
86+
pip3 install -e ".[all_gpu_dev]"
8587
8688
If you want install TensorLayer 1.X, the simplest way to install TensorLayer 1.X is as follow. It will also install the numpy and matplotlib automatically.
8789

8890
.. code-block:: bash
8991
90-
[stable version] pip install tensorlayer==1.x.x
92+
[stable version] pip3 install tensorlayer==1.x.x
9193
9294
However, if you want to modify or extend TensorLayer 1.X, you can download the repository from
9395
`Github`_ and install it as follow.
9496

9597
.. code-block:: bash
9698
9799
cd to the root of the git tree
98-
pip install -e .
100+
pip3 install -e .
99101
100102
This command will run the ``setup.py`` to install TensorLayer. The ``-e`` reflects
101103
editable, then you can edit the source code in ``tensorlayer`` folder, and ``import`` the edited
@@ -194,9 +196,9 @@ For TensorLayer, please refer to the steps mentioned above.
194196

195197
.. code-block:: bash
196198
197-
pip install tensorflow #CPU version
198-
pip install tensorflow-gpu   #GPU version (GPU version and CPU version just choose one)
199-
pip install tensorlayer       #Install tensorlayer
199+
pip3 install tensorflow #CPU version
200+
pip3 install tensorflow-gpu   #GPU version (GPU version and CPU version just choose one)
201+
pip3 install tensorlayer       #Install tensorlayer
200202
201203
202204

examples/basic_tutorials/tutorial_cifar10_cnn_static.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4+
import multiprocessing
45
import time
6+
57
import numpy as np
6-
import multiprocessing
78
import tensorflow as tf
9+
810
import tensorlayer as tl
911
from tensorlayer.layers import (BatchNorm, Conv2d, Dense, Flatten, Input, LocalResponseNorm, MaxPool2d)
1012
from tensorlayer.models import Model
@@ -122,7 +124,7 @@ def _map_fn_train(img, target):
122124

123125
def _map_fn_test(img, target):
124126
# 1. Crop the central [height, width] of the image.
125-
img = tf.image.resize_with_crop_or_pad(img, 24, 24)
127+
img = tf.image.resize_with_pad(img, 24, 24)
126128
# 2. Subtract off the mean and divide by the variance of the pixels.
127129
img = tf.image.per_image_standardization(img)
128130
img = tf.reshape(img, (24, 24, 3))

examples/basic_tutorials/tutorial_mnist_mlp_dynamic.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import time
2+
23
import numpy as np
34
import tensorflow as tf
5+
46
import tensorlayer as tl
57
from tensorlayer.layers import Dense, Dropout, Input
68
from tensorlayer.models import Model

examples/basic_tutorials/tutorial_mnist_mlp_dynamic_2.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import time
2+
23
import numpy as np
34
import tensorflow as tf
5+
46
import tensorlayer as tl
57
from tensorlayer.layers import Dense, Dropout, Input, LayerList
68
from tensorlayer.models import Model

examples/basic_tutorials/tutorial_mnist_mlp_static.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import pprint
12
import time
3+
24
import numpy as np
35
import tensorflow as tf
6+
47
import tensorlayer as tl
58
from tensorlayer.layers import Dense, Dropout, Input
69
from tensorlayer.models import Model
@@ -29,7 +32,6 @@ def get_model(inputs_shape):
2932

3033

3134
MLP = get_model([None, 784])
32-
import pprint
3335
pprint.pprint(MLP.config)
3436

3537
## start training

examples/basic_tutorials/tutorial_mnist_mlp_static_2.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import time
2+
23
import numpy as np
34
import tensorflow as tf
5+
46
import tensorlayer as tl
57
from tensorlayer.layers import Dense, Dropout, Input
68
from tensorlayer.models import Model

examples/basic_tutorials/tutorial_mnist_siamese.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import time
1515

1616
import numpy as np
17-
1817
import tensorflow as tf
18+
1919
import tensorlayer as tl
2020
from tensorlayer.layers import Dense, Dropout, Flatten, Input
2121
from tensorlayer.models import Model

examples/basic_tutorials/tutorial_mnist_simple.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# -*- coding: utf-8 -*-
33

44
import numpy as np
5-
65
import tensorflow as tf
6+
77
import tensorlayer as tl
88

99
tl.logging.set_verbosity(tl.logging.DEBUG)

examples/data_process/tutorial_fast_affine_transform.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
import time
1010

1111
import numpy as np
12+
import tensorflow as tf
1213

1314
import cv2
14-
import tensorflow as tf
1515
import tensorlayer as tl
1616

1717
# tl.logging.set_verbosity(tl.logging.DEBUG)
@@ -98,7 +98,6 @@ def _map_fn(image_path, target):
9898
st = time.time()
9999
for img, target in dataset:
100100
n_step += 1
101-
pass
102101
assert n_step == n_epoch * n_data / batch_size
103102
print("dataset APIs took %fs for each image" % ((time.time() - st) / batch_size / n_step)) # CPU ~ 100%
104103

examples/data_process/tutorial_tf_dataset_voc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import time
1414

1515
import numpy as np
16-
1716
import tensorflow as tf
17+
1818
import tensorlayer as tl
1919

2020
# tf.logging.set_verbosity(tf.logging.DEBUG)

examples/data_process/tutorial_tfrecord.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import os
2323

2424
import numpy as np
25+
import tensorflow as tf
2526
from PIL import Image
2627

27-
import tensorflow as tf
2828
import tensorlayer as tl
2929

3030
## Save data ==================================================================

examples/data_process/tutorial_tfrecord2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
import os
1515

1616
import numpy as np
17-
1817
# import matplotlib
1918
# matplotlib.use('GTK')
2019
import tensorflow as tf
20+
2121
import tensorlayer as tl
2222

2323
# Download data, and convert to TFRecord format, see ```tutorial_tfrecord.py```

examples/data_process/tutorial_tfrecord3.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import os
2020

2121
import numpy as np
22+
import tensorflow as tf
2223
from PIL import Image
2324

24-
import tensorflow as tf
2525
import tensorlayer as tl
2626

2727

@@ -231,8 +231,8 @@ def distort_image(image, thread_id):
231231

232232

233233
def prefetch_input_data(
234-
reader, file_pattern, is_training, batch_size, values_per_shard, input_queue_capacity_factor=16,
235-
num_reader_threads=1, shard_queue_name="filename_queue", value_queue_name="input_queue"
234+
reader, file_pattern, is_training, batch_size, values_per_shard, input_queue_capacity_factor=16,
235+
num_reader_threads=1, shard_queue_name="filename_queue", value_queue_name="input_queue"
236236
):
237237
"""Prefetches string values from disk into an input queue.
238238

examples/database/dispatch_tasks.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import time
77

88
import tensorflow as tf
9+
910
import tensorlayer as tl
1011

1112
tl.logging.set_verbosity(tl.logging.DEBUG)

examples/database/task_script.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Sample task script."""
22

33
import tensorflow as tf
4+
45
import tensorlayer as tl
56

67
# tf.logging.set_verbosity(tf.logging.DEBUG)

0 commit comments

Comments
 (0)