Python 如何恢复登录
当我们声明变量logits时,变量: 完全连接/重量比为1:0 完全连接/偏置1:0Python 如何恢复登录,python,tensorflow,Python,Tensorflow,当我们声明变量logits时,变量: 完全连接/重量比为1:0 完全连接/偏置1:0 ROOT_PATH = "datasets" directory = TEST_DATA_SET test_data_dir = os.path.join(ROOT_PATH, directory, "Testing") # Restore session and variables/nodes/weights session = tf.Session() meta_file = os.path.join("
ROOT_PATH = "datasets"
directory = TEST_DATA_SET
test_data_dir = os.path.join(ROOT_PATH, directory, "Testing")
# Restore session and variables/nodes/weights
session = tf.Session()
meta_file = os.path.join("output", MODEL_DIR, "save.ckpt.meta")
new_saver = tf.train.import_meta_graph(meta_file)
checkpoint_dir = os.path.join("output", MODEL_DIR)
new_saver.restore(session, tf.train.latest_checkpoint(checkpoint_dir))
# Load the test dataset.
test_images, test_labels = load_data(test_data_dir)
# Transform the images, just like we did with the training set.
test_images32 = [skimage.transform.resize(image, (IMAGE_SCALE_SIZE_X, IMAGE_SCALE_SIZE_Y)) for image in test_images]
# Create a graph to hold the model.
graph = session.graph
#with graph.as_default():
# Placeholders for inputs and labels.
images_ph = tf.placeholder(tf.float32, [None, IMAGE_SCALE_SIZE_X, IMAGE_SCALE_SIZE_Y, 3])
# Flatten input from: [None, height, width, channels]
# To: [None, height * width * channels] == [None, 3072]
images_flat = tf.contrib.layers.flatten(images_ph)
# Fully connected layer.
# Generates logits of size [None, 62]
logits = tf.contrib.layers.fully_connected(images_flat, 62, tf.nn.relu)
predicted_labels = tf.argmax(logits, 1)
都是创造出来的。如果不发生这种情况,我如何恢复登录
所有全局变量为:
完全连接/重量:0,
完全连接/偏置:0,
beta1_功率:0,
β2_功率:0,
完全连接/weights/Adam:0,
完全连接/重量/亚当1:0,
完全连接/偏置/Adam:0,
完全连接/偏差/Adam_1:0,
完全连接/重量比为1:0,
完全连接/偏置1:0
ROOT_PATH = "datasets"
directory = TEST_DATA_SET
test_data_dir = os.path.join(ROOT_PATH, directory, "Testing")
# Restore session and variables/nodes/weights
session = tf.Session()
meta_file = os.path.join("output", MODEL_DIR, "save.ckpt.meta")
new_saver = tf.train.import_meta_graph(meta_file)
checkpoint_dir = os.path.join("output", MODEL_DIR)
new_saver.restore(session, tf.train.latest_checkpoint(checkpoint_dir))
# Load the test dataset.
test_images, test_labels = load_data(test_data_dir)
# Transform the images, just like we did with the training set.
test_images32 = [skimage.transform.resize(image, (IMAGE_SCALE_SIZE_X, IMAGE_SCALE_SIZE_Y)) for image in test_images]
# Create a graph to hold the model.
graph = session.graph
#with graph.as_default():
# Placeholders for inputs and labels.
images_ph = tf.placeholder(tf.float32, [None, IMAGE_SCALE_SIZE_X, IMAGE_SCALE_SIZE_Y, 3])
# Flatten input from: [None, height, width, channels]
# To: [None, height * width * channels] == [None, 3072]
images_flat = tf.contrib.layers.flatten(images_ph)
# Fully connected layer.
# Generates logits of size [None, 62]
logits = tf.contrib.layers.fully_connected(images_flat, 62, tf.nn.relu)
predicted_labels = tf.argmax(logits, 1)
我明白了
Logits = tf.nn.relu(tf.matmul(images, weights) + biases)