Skip to content

Commit ffd7341

Browse files
zsdonghaoluomai
authored andcommitted
Set the logging to the DEBUG level in all tutorials. (#697)
* add logging debug to all tutorials * update changelong * add space suggested by milo
1 parent ed68215 commit ffd7341

38 files changed

+113
-38
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ To release a new version, please update the changelog as followed:
112112
- `test_activations.py` added
113113
- Tutorials:
114114
- `tutorial_tfslim` has been introduced to show how to use `SlimNetsLayer`
115+
- add the following to all tutorials:
116+
117+
```python
118+
tf.logging.set_verbosity(tf.logging.DEBUG)
119+
tl.logging.set_verbosity(tl.logging.DEBUG)
120+
```
115121

116122
### Changed
117123
- Tensorflow CPU & GPU dependencies moved to separated requirement files in order to allow PyUP.io to parse them

example/tutorial_atari_pong.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
"""
2222

2323
import time
24-
24+
import gym
2525
import numpy as np
2626
import tensorflow as tf
27-
28-
import gym
2927
import tensorlayer as tl
3028
from tensorlayer.layers import DenseLayer, InputLayer
3129

30+
tf.logging.set_verbosity(tf.logging.DEBUG)
31+
tl.logging.set_verbosity(tl.logging.DEBUG)
32+
3233
# hyper-parameters
3334
image_size = 80
3435
D = image_size * image_size

example/tutorial_binarynet_cifar10_tfrecord.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@
4141

4242
import os
4343
import time
44-
4544
import tensorflow as tf
46-
4745
import tensorlayer as tl
4846

47+
tf.logging.set_verbosity(tf.logging.DEBUG)
48+
tl.logging.set_verbosity(tl.logging.DEBUG)
49+
4950
model_file_name = "./model_cifar10_tfrecord.ckpt"
5051
resume = False # load model, resume from previous checkpoint?
5152

example/tutorial_binarynet_mnist_cnn.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import tensorflow as tf
66
import tensorlayer as tl
77

8+
tf.logging.set_verbosity(tf.logging.DEBUG)
9+
tl.logging.set_verbosity(tl.logging.DEBUG)
10+
811
X_train, y_train, X_val, y_val, X_test, y_test = tl.files.load_mnist_dataset(shape=(-1, 28, 28, 1))
912
# X_train, y_train, X_test, y_test = tl.files.load_cropped_svhn(include_extra=False)
1013

example/tutorial_bipedalwalker_a3c_continuous_action.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@
3333

3434
import multiprocessing
3535
import threading
36-
3736
import numpy as np
3837
import tensorflow as tf
39-
4038
import gym
4139
import tensorlayer as tl
4240
from tensorlayer.layers import DenseLayer, InputLayer
4341

42+
tf.logging.set_verbosity(tf.logging.DEBUG)
43+
tl.logging.set_verbosity(tl.logging.DEBUG)
44+
4445
GAME = 'BipedalWalker-v2' # BipedalWalkerHardcore-v2
4546
OUTPUT_GRAPH = False
4647
LOG_DIR = './log'

example/tutorial_cartpole_ac.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@
3333
"""
3434

3535
import time
36-
3736
import numpy as np
3837
import tensorflow as tf
39-
4038
import gym
4139
import tensorlayer as tl
4240
from tensorlayer.layers import DenseLayer, InputLayer
4341

42+
tf.logging.set_verbosity(tf.logging.DEBUG)
43+
tl.logging.set_verbosity(tl.logging.DEBUG)
44+
4445
np.random.seed(2)
4546
tf.set_random_seed(2) # reproducible
4647

example/tutorial_cifar10.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
import tensorlayer as tl
88
from tensorlayer.layers import *
99

10+
tf.logging.set_verbosity(tf.logging.DEBUG)
11+
tl.logging.set_verbosity(tl.logging.DEBUG)
12+
1013
sess = tf.InteractiveSession()
1114

1215
X_train, y_train, X_test, y_test = tl.files.load_cifar10_dataset(shape=(-1, 32, 32, 3), plotable=False)

example/tutorial_cifar10_tfrecord.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@
4141

4242
import os
4343
import time
44-
4544
import tensorflow as tf
46-
4745
import tensorlayer as tl
4846
from tensorlayer.layers import *
4947

48+
tf.logging.set_verbosity(tf.logging.DEBUG)
49+
tl.logging.set_verbosity(tl.logging.DEBUG)
50+
5051
model_file_name = "./model_cifar10_tfrecord.ckpt"
5152
resume = False # load model, resume from previous checkpoint?
5253

example/tutorial_dorefanet_cifar10_tfrecord.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@
4141

4242
import os
4343
import time
44-
4544
import tensorflow as tf
46-
4745
import tensorlayer as tl
4846

47+
tf.logging.set_verbosity(tf.logging.DEBUG)
48+
tl.logging.set_verbosity(tl.logging.DEBUG)
49+
4950
model_file_name = "./model_cifar10_tfrecord.ckpt"
5051
resume = False # load model, resume from previous checkpoint?
5152

example/tutorial_dorefanet_mnist_cnn.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import tensorflow as tf
66
import tensorlayer as tl
77

8+
tf.logging.set_verbosity(tf.logging.DEBUG)
9+
tl.logging.set_verbosity(tl.logging.DEBUG)
10+
811
X_train, y_train, X_val, y_val, X_test, y_test = tl.files.load_mnist_dataset(shape=(-1, 28, 28, 1))
912
# X_train, y_train, X_test, y_test = tl.files.load_cropped_svhn(include_extra=False)
1013

0 commit comments

Comments
 (0)