Skip to content

Commit 6907665

Browse files
zsdonghaoJonathan DEKHTIAR
authored andcommitted
remove graph api (#818)
* remove graph api * changelog * timeout test * codacy * remove graph in tl.models * increase timeout time * remove tl in tests * Additional Cleaning * Timeout time added * tests directory refactored * Tests Fix Update python, 2.6 * YAPF Cleaning * get_env fix * Python 2 fix applied * Python 2 Error fixes * TL 1.10.1rc0 released * Doc and YAPF Fix * Test YAPF Fix * RTD Lazy Import Fix * Travis config restored * Revert "Travis config restored" This reverts commit 03fe83e.
1 parent badd3d5 commit 6907665

Some content is hidden

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

60 files changed

+917
-216
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,4 @@ update_tl.py
127127
*.gz
128128
*.npz
129129
venv_doc/
130+
venv_py2/

.travis.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,12 @@ env:
2121
# Backward Compatibility in insured for release less than 1 year old.
2222
# https://pypi.org/project/tensorflow/#history
2323
matrix:
24-
- _TF_VERSION=1.10.0 # Remove on Apr 28, 2019
24+
- _TF_VERSION=1.10.1 # Remove on Apr 28, 2019
2525
- _TF_VERSION=1.9.0 # Remove on Apr 28, 2019
2626
- _TF_VERSION=1.8.0 # Remove on Apr 28, 2019
2727
- _TF_VERSION=1.7.1 # Remove on May 08, 2019
2828
- _TF_VERSION=1.7.0 # Remove on Mar 29, 2019
2929
- _TF_VERSION=1.6.0 # Remove on Mar 01, 2019
30-
# - _TF_VERSION=1.5.1 # Remove on Mar 20, 2019
31-
# - _TF_VERSION=1.5.0 # Remove on Jan 26, 2019
32-
# - _TF_VERSION=1.4.1 # Remove on Dec 08, 2018
33-
# - _TF_VERSION=1.4.0 # Remove on Nov 01, 2018
3430

3531
global:
3632

@@ -61,7 +57,7 @@ install:
6157
if [[ -v _DOC_AND_YAPF_TEST ]]; then
6258
pip install tensorflow
6359
pip install yapf
64-
pip install -r requirements/requirements_doc.txt
60+
pip install -e .[doc]
6561
else
6662
pip install tensorflow==$_TF_VERSION
6763
pip install -e .[all_cpu_dev]
@@ -97,7 +93,7 @@ deploy:
9793
on:
9894
tags: true
9995
python: '3.6'
100-
condition: '$_TF_VERSION = 1.10.0'
96+
condition: '$_TF_VERSION = 1.10.1'
10197

10298
# Documentation: https://docs.travis-ci.com/user/deployment/releases/
10399
- provider: releases
@@ -110,4 +106,4 @@ deploy:
110106
on:
111107
tags: true
112108
python: '3.6'
113-
condition: '$_TF_VERSION = 1.10.0'
109+
condition: '$_TF_VERSION = 1.10.1'

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ To release a new version, please update the changelog as followed:
145145
### Removed
146146

147147
- `conv_layers()` has been removed in both vgg16 and vgg19(PR #710)
148+
- graph API (PR #818)
148149

149150
### Fixed
150151

@@ -171,7 +172,7 @@ To release a new version, please update the changelog as followed:
171172
- @DEKHTIARJonathan: #739 #747 #750 #754
172173
- @lgarithm: #705 #700
173174
- @OwenLiuzZ: #698 #710 #775 #776
174-
- @zsdonghao: #711 #712 #734 #736 #737 #700 #751 #809
175+
- @zsdonghao: #711 #712 #734 #736 #737 #700 #751 #809 #818
175176
- @luomai: #700 #751 #766 #802
176177
- @XJTUWYD: #735
177178
- @mutewall: #735

docs/modules/files.rst

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ Load benchmark dataset, save and restore model, save and load variables.
3131
load_and_assign_npz
3232
save_npz_dict
3333
load_and_assign_npz_dict
34+
save_ckpt
35+
load_ckpt
36+
37+
..
3438
save_graph
3539
load_graph
3640
save_graph_and_params
3741
load_graph_and_params
38-
save_ckpt
39-
load_ckpt
40-
4142
4243
save_any_to_npy
4344
load_npy_to_any
@@ -183,21 +184,22 @@ Load network from dict (npz)
183184
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184185
.. autofunction:: load_and_assign_npz_dict
185186

186-
Save network architecture as a graph
187-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188-
.. autofunction:: save_graph
187+
..
188+
Save network architecture as a graph
189+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
190+
.. autofunction:: save_graph
189191
190-
Load network architecture from a graph
191-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
192-
.. autofunction:: load_graph
192+
Load network architecture from a graph
193+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194+
.. autofunction:: load_graph
193195

194-
Save network architecture and parameters
195-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
196-
.. autofunction:: save_graph_and_params
196+
Save network architecture and parameters
197+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198+
.. autofunction:: save_graph_and_params
197199

198-
Load network architecture and parameters
199-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200-
.. autofunction:: load_graph_and_params
200+
Load network architecture and parameters
201+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
202+
.. autofunction:: load_graph_and_params
201203

202204
Save network into ckpt
203205
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def req_file(filename, folder="requirements"):
8989

9090

9191
# Readthedocs requires TF 1.5.0 to build properly
92-
if os.environ.get('READTHEDOCS', None) == 'True':
92+
if 'READTHEDOCS' in os.environ:
9393
ext_modules = [
9494
Extension('install_requirements_for_rtd', []),
9595
]

tensorlayer/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# -*- coding: utf-8 -*-
33
"""Deep learning and Reinforcement learning library for Researchers and Engineers"""
44

5-
from __future__ import absolute_import
6-
75
import os
86
from distutils.version import LooseVersion
97

tensorlayer/db.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99

1010
import gridfs
1111
import pymongo
12-
from tensorlayer.files import load_graph_and_params, exists_or_mkdir, del_folder
12+
13+
# from tensorlayer.files import load_graph_and_params
14+
from tensorlayer.files import exists_or_mkdir
15+
from tensorlayer.files import del_folder
16+
1317
from tensorlayer import logging
1418

1519
import tensorflow as tf

tensorlayer/distributed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(
107107
self, training_dataset, build_training_func, optimizer, optimizer_args, batch_size=32, num_epochs=100,
108108
prefetch_buffer_size=None, shuffle_data=False, shuffle_seed=0, checkpoint_dir=None,
109109
scaling_learning_rate=True, log_step_size=1, validation_dataset=None, build_validation_func=None,
110-
max_iteration=math.inf
110+
max_iteration=float('inf')
111111
):
112112
# Initialize Horovod.
113113
hvd.init()

tensorlayer/files/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
'save_ckpt',
6868
'save_npz',
6969
'save_npz_dict',
70-
'save_graph',
71-
'load_graph',
72-
'save_graph_and_params',
73-
'load_graph_and_params',
70+
#'save_graph',
71+
#'load_graph',
72+
#'save_graph_and_params',
73+
#'load_graph_and_params',
7474
]

tensorlayer/files/utils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141

4242
import tensorflow as tf
4343
from tensorflow.python.platform import gfile
44-
import tensorlayer as tl # it is used in eval() of _graph2net
44+
45+
import tensorlayer as tl
4546
from tensorlayer import logging
4647
from tensorlayer import nlp
4748
from tensorlayer import utils
@@ -71,10 +72,10 @@
7172
'save_ckpt',
7273
'save_npz',
7374
'save_npz_dict',
74-
'save_graph',
75-
'load_graph',
76-
'save_graph_and_params',
77-
'load_graph_and_params',
75+
#'save_graph',
76+
#'load_graph',
77+
#'save_graph_and_params',
78+
#'load_graph_and_params',
7879
]
7980

8081

@@ -1894,6 +1895,7 @@ def load_ckpt(sess=None, mode_name='model.ckpt', save_dir='checkpoint', var_list
18941895
logging.info("[*] load ckpt fail ...")
18951896

18961897

1898+
'''
18971899
def save_graph(network=None, name='graph.pkl'):
18981900
"""Save the architecture of TL model into a pickle file. No parameters be saved.
18991901
@@ -2058,6 +2060,7 @@ def load_graph_and_params(name='model', sess=None):
20582060
network = load_graph(name=os.path.join(name, 'graph.pkl'))
20592061
load_and_assign_npz(sess=sess, name=os.path.join(name, 'params.npz'), network=network)
20602062
return network
2063+
'''
20612064

20622065

20632066
def save_any_to_npy(save_dict=None, name='file.npy'):

0 commit comments

Comments
 (0)