Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ test:
python tests/test_mnist_simple.py

format:
yapf -i example/*.py
yapf -i tensorlayer/*.py
yapf -i tensorlayer/**/*.py

autoflake -i example/*.py
autoflake -i tensorlayer/*.py
autoflake -i tensorlayer/**/*.py

isort -rc example
isort -rc tensorlayer

yapf -i example/*.py
yapf -i tensorlayer/*.py
yapf -i tensorlayer/**/*.py

install3:
pip3 install -U . --user
3 changes: 2 additions & 1 deletion example/tutorial_atari_pong.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@

import time

import gym
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *

import gym

# hyper-parameters
image_size = 80
D = image_size * image_size
Expand Down
3 changes: 2 additions & 1 deletion example/tutorial_bipedalwalker_a3c_continuous_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
import multiprocessing
import threading

import gym
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *

import gym

GAME = 'BipedalWalker-v2' # BipedalWalkerHardcore-v2
OUTPUT_GRAPH = False
LOG_DIR = './log'
Expand Down
3 changes: 2 additions & 1 deletion example/tutorial_cartpole_ac.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@

import time

import gym
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *

import gym

np.random.seed(2)
tf.set_random_seed(2) # reproducible

Expand Down
2 changes: 1 addition & 1 deletion example/tutorial_cifar10_tfrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

"""

import io
import os
import time

# import numpy as np
import tensorflow as tf
import tensorlayer as tl
Expand Down
4 changes: 3 additions & 1 deletion example/tutorial_frozenlake_dqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
"""

import time
import gym

import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *

import gym

env = gym.make('FrozenLake-v0')


Expand Down
4 changes: 3 additions & 1 deletion example/tutorial_frozenlake_q_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"""

import time
import gym

import numpy as np

import gym

## Load the environment
env = gym.make('FrozenLake-v0')
render = False # display the game environment
Expand Down
3 changes: 2 additions & 1 deletion example/tutorial_generate_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
import re
import time

import nltk
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *

import nltk

# # _UNK = "_UNK"


Expand Down
1 change: 1 addition & 0 deletions example/tutorial_image_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import time

import tensorlayer as tl

X_train, y_train, X_test, y_test = tl.files.load_cifar10_dataset(shape=(-1, 32, 32, 3), plotable=False)
Expand Down
3 changes: 2 additions & 1 deletion example/tutorial_inceptionV3_tfslim.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import os
import time

import numpy as np
# from tensorflow.contrib.slim.python.slim.nets.resnet_v2 import resnet_v2_152
# from tensorflow.contrib.slim.python.slim.nets.vgg import vgg_16
Expand All @@ -33,7 +34,7 @@
import tensorlayer as tl
# from scipy.misc import imread, imresize
# from tensorflow.contrib.slim.python.slim.nets.alexnet import alexnet_v2
from tensorflow.contrib.slim.python.slim.nets.inception_v3 import (inception_v3, inception_v3_arg_scope) #, inception_v3_base)
from tensorflow.contrib.slim.python.slim.nets.inception_v3 import (inception_v3, inception_v3_arg_scope)

slim = tf.contrib.slim
try:
Expand Down
4 changes: 3 additions & 1 deletion example/tutorial_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
# -*- coding: utf-8 -*-

import time

import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *

from keras import backend as K
from keras.layers import *
from tensorlayer.layers import *

X_train, y_train, X_val, y_val, X_test, y_test = \
tl.files.load_mnist_dataset(shape=(-1, 784))
Expand Down
1 change: 1 addition & 0 deletions example/tutorial_mlp_dropout1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# train the network
import time

import tensorflow as tf
import tensorlayer as tl

Expand Down
1 change: 1 addition & 0 deletions example/tutorial_mlp_dropout2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# train the network
import time

import tensorflow as tf
import tensorlayer as tl

Expand Down
1 change: 1 addition & 0 deletions example/tutorial_mnist_float16.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-

import time

import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
Expand Down
1 change: 1 addition & 0 deletions example/tutorial_ptb_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"""

import time

import numpy as np
import tensorflow as tf
import tensorlayer as tl
Expand Down
1 change: 1 addition & 0 deletions example/tutorial_ptb_lstm_state_is_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"""

import time

import numpy as np
import tensorflow as tf
import tensorlayer as tl
Expand Down
1 change: 1 addition & 0 deletions example/tutorial_tfrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"""

import os

import numpy as np
import tensorflow as tf
import tensorlayer as tl
Expand Down
1 change: 1 addition & 0 deletions example/tutorial_tfrecord2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""

import os

import numpy as np
# import matplotlib
# matplotlib.use('GTK')
Expand Down
1 change: 1 addition & 0 deletions example/tutorial_tfrecord3.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import json
import os

import numpy as np
import tensorflow as tf
import tensorlayer as tl
Expand Down
1 change: 1 addition & 0 deletions example/tutorial_vgg16.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"""

import os

import tensorlayer as tl
from scipy.misc import imread, imresize
from tensorlayer.layers import *
Expand Down
1 change: 0 additions & 1 deletion example/tutorial_vgg19.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

"""

import inspect
import os
import time

Expand Down
2 changes: 1 addition & 1 deletion tensorlayer/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def info(fmt, *args):


def warning(fmt, *args):
logging.warning(fmt, *args)
logging.warning(fmt, *args)
1 change: 1 addition & 0 deletions tensorlayer/cli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse

from tensorlayer.cli import train

if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions tensorlayer/layers/importer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

from tensorflow.python.util.deprecation import deprecated

from .core import *


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import tensorflow as tf

from roi_pooling_ops import roi_pooling


Expand Down
1 change: 1 addition & 0 deletions tensorlayer/third_party/roi_pooling/roi_pooling_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import tensorflow as tf

from roi_pooling.roi_pooling_ops import roi_pooling

# input feature map going into the RoI pooling
Expand Down