Skip to content

Commit

Permalink
update flake config and remove flake8 issues in the code (python3)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatWie committed Aug 17, 2018
1 parent 12d950d commit 1bb79ab
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion custom_op/setup.cfg
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 120
ignore = D102,E402,F403,N806,N802,N803,F405
ignore = D102,E402,F403,N806,N802,N803,F405,E111,E114
4 changes: 2 additions & 2 deletions examples/keras/keras_graph.py
Expand Up @@ -2,7 +2,7 @@
import numpy as np
sess = tf.Session()

from keras import backend as K
from keras import backend as K # noqa
K.set_session(sess)


Expand All @@ -22,4 +22,4 @@

saver = tf.train.Saver(tf.global_variables())
saver.save(sess, './exported/my_model')
tf.train.write_graph(sess.graph, '.', "./exported/graph.pb", as_text=False)
tf.train.write_graph(sess.graph, '.', "./exported/graph.pb", as_text=False)
12 changes: 6 additions & 6 deletions inference/example.py
Expand Up @@ -17,13 +17,13 @@
tf.train.write_graph(sess.graph, '.', "./exported/graph.pb_txt", as_text=True)

t1 = tf.get_default_graph().get_tensor_by_name('output:0')
t2 = tf.get_default_graph().get_tensor_by_name('dense/kernel:0');
t2 = tf.get_default_graph().get_tensor_by_name('dense/kernel:0')
t3 = tf.get_default_graph().get_tensor_by_name('dense/bias:0')

t1, t2, t3, x = sess.run([t1, t2, t3, x], {x: val})

print tf.global_variables()
print "input " ,x
print "output " ,t1
print "dense/kernel:0 " ,t2
print "dense/bias:0 " ,t3
print(tf.global_variables())
print("input ", x)
print("output ", t1)
print("dense/kernel:0 ", t2)
print("dense/bias:0 ", t3)
1 change: 0 additions & 1 deletion inference/python/inference2.py
Expand Up @@ -11,7 +11,6 @@
filename_tensor_name = metaGraph.as_saver_def().filename_tensor_name
sess.run(restore_op, {filename_tensor_name: './exported/my_model'})


x = tf.get_default_graph().get_tensor_by_name('input:0')
t1 = tf.get_default_graph().get_tensor_by_name('output:0')
t2 = tf.get_default_graph().get_tensor_by_name('dense/kernel:0')
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 120
ignore = D102,E402,F403,N806,N802,N803,F405,E111,E114

0 comments on commit 1bb79ab

Please sign in to comment.