Verified Commit 391051e1 authored by Kiryuu Sakuya's avatar Kiryuu Sakuya 🎵
Browse files

Fix typo

parent f5fb10ab
import sys
import tensorflow as tf
import os
os.environ[\"TF_CPP_MIN_LOG_LEVEL\"]='3'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='3'
import warnings
warnings.filterwarnings('ignore')
sys.path.append('step3')
......@@ -85,5 +85,5 @@ with tf.Session() as sess:
print('current accuracy: ', str(acc_v))
# if acc_v \u003e 0.7 and acc_v \u003e max_acc:
# max_acc = acc_v
# saver.save(sess, \"step10/Model/FinalNet\")
# saver.save(sess, "step10/Model/FinalNet")
#********** End **********#
\ No newline at end of file
......@@ -80,5 +80,5 @@ with tf.Session() as sess:
if acc_v \u003e 0.7 and acc_v \u003e max_acc:
max_acc = acc_v
saver.save(sess, \"step10/Model/FinalNet\")
saver.save(sess, "step10/Model/FinalNet")
......@@ -89,4 +89,4 @@ with tf.Session() as sess:
if acc_v \u003e 0.7 and acc_v \u003e max_acc:
max_acc = acc_v
saver.save(sess, \"step10/Model/FinalNet\")
\ No newline at end of file
saver.save(sess, "step10/Model/FinalNet")
\ No newline at end of file
import os
os.environ[\"TF_CPP_MIN_LOG_LEVEL\"]='3'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='3'
import warnings
warnings.filterwarnings('ignore')
......
import os
os.environ[\"TF_CPP_MIN_LOG_LEVEL\"]='3'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='3'
import warnings
warnings.filterwarnings('ignore')
......@@ -25,19 +25,19 @@ with tf.Session() as sess:
# for op in graph.get_operations():
# print(op.name)
# mm = graph.get_tensor_by_name(\"batch_normalization/moving_mean:0\")
# mm = graph.get_tensor_by_name("batch_normalization/moving_mean:0")
# print(sess.run(mm))
# exit()
G_Valid = batchGenerator(batchSize=8, basePath='data/processed/valid_224')
X_v, Y_v = G_Valid.getBatch()
batchImgInput = graph.get_tensor_by_name(\"batchImgInput:0\")
labels = graph.get_tensor_by_name(\"Labels:0\")
keeProb = graph.get_tensor_by_name(\"dropout_keep_prob:0\")
batchImgInput = graph.get_tensor_by_name("batchImgInput:0")
labels = graph.get_tensor_by_name("Labels:0")
keeProb = graph.get_tensor_by_name("dropout_keep_prob:0")
try:
BNTraining = graph.get_tensor_by_name(\"BNTraining:0\")
batchSize = graph.get_tensor_by_name(\"InputBatchSize:0\")
BNTraining = graph.get_tensor_by_name("BNTraining:0")
batchSize = graph.get_tensor_by_name("InputBatchSize:0")
except:
BNTraining, batchSize = None, None
......@@ -52,7 +52,7 @@ with tf.Session() as sess:
else:
feed_dict = {batchImgInput: X_v, labels: Y_v, keeProb: 1.}
out = graph.get_tensor_by_name(\"model_outputs/BiasAdd:0\")
out = graph.get_tensor_by_name("model_outputs/BiasAdd:0")
output_v = softmax(
sess.run(out,
feed_dict=feed_dict))
......
......@@ -11,7 +11,7 @@ class batchGenerator:
def __init__(self, basePath='data/processed/train_224/', batchSize=256):
'''
数据集中有四类图片分别是'bus','family sedan','fire engine','racing car',
每个图片的文件名形式为\"XXX (id).jpg\"\"XXX (id)_flipx.jpg\",例如\"bus (1).jpg\",\"bus (1)_flipx.jpg\"
每个图片的文件名形式为"XXX (id).jpg"或"XXX (id)_flipx.jpg",例如"bus (1).jpg","bus (1)_flipx.jpg"
:param basePath:数据集路径
:param batchSize: 每次获取的图片数量
......
import tensorflow as tf
import os
# os.environ[\"TF_CPP_MIN_LOG_LEVEL\"]='3'
# os.environ["TF_CPP_MIN_LOG_LEVEL"]='3'
#----以下是答案部分 begin----#
# 定义placeholder 开始
......@@ -62,7 +62,7 @@ train = tf.train.AdamOptimizer().minimize(loss)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
tf.train.export_meta_graph(filename=\"step4/modelInfo/AlexNet\",
tf.train.export_meta_graph(filename="step4/modelInfo/AlexNet",
graph=tf.get_default_graph())
tf.reset_default_graph()
\ No newline at end of file
......@@ -52,5 +52,5 @@ import tensorflow as tf
#---否则影响测评---#
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
tf.train.export_meta_graph(filename=\"step4/userModelInfo/AlexNet\",
tf.train.export_meta_graph(filename="step4/userModelInfo/AlexNet",
graph=tf.get_default_graph())
\ No newline at end of file
import os
os.environ[\"TF_CPP_MIN_LOG_LEVEL\"]='3'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='3'
import warnings
warnings.filterwarnings('ignore')
......
......@@ -54,8 +54,8 @@ train = tf.train.AdamOptimizer().minimize(loss)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
# saver.save(sess, \"modelInfo/VGGNet\")
tf.train.export_meta_graph(filename=\"step6/modelInfo/VGGNet\",
# saver.save(sess, "modelInfo/VGGNet")
tf.train.export_meta_graph(filename="step6/modelInfo/VGGNet",
graph=tf.get_default_graph())
tf.reset_default_graph()
# if __name__ == '__main__':
......
import os
os.environ[\"TF_CPP_MIN_LOG_LEVEL\"]='3'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='3'
import warnings
warnings.filterwarnings('ignore')
......
import os
os.environ[\"TF_CPP_MIN_LOG_LEVEL\"]='3'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='3'
import warnings
warnings.filterwarnings('ignore')
......
import os
os.environ[\"TF_CPP_MIN_LOG_LEVEL\"]='3'
os.environ["TF_CPP_MIN_LOG_LEVEL"]='3'
import warnings
warnings.filterwarnings('ignore')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment