当我想训练和测试我的图形时,我会得到Tensor Tensor("Placeholder:0", shape=(128, 784), dtype=float32) is not an element of this graph.。堆栈跟踪没有多大帮助,我无法从中得到更多的信息。我真的不明白这个错误是如何发生的,每个数据集都应该通过with graphFully.as_default():自动添加到with graphFully.as_default():中,然后我用with tf.Session(graph=graph) as session:调用它。
欢迎就如何简化图表提出建
我使用卷积神经网络对3种标签中的图像进行分类。我做了所有的训练和测试,获得了60%的准确率。然后,我保存了这个模型,我想加载一个图像,并将其分类为其中一个标签。我使用的代码:
X_new = process_data() # That's my input image after some processing
pred = convolutional_neural_network(x) # That's my CNN
with tf.Session() as sess:
# Here I restore the trained model
saver = t
我正在尝试在notMNIST上训练一个具有多个隐藏层的神经网络。当我有一个隐藏层时,它工作得很好,但当我添加多个隐藏层时,我开始得到nan来弥补损失。下面是我使用的代码
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
from six.moves import range
batch_size = 128
num_hidden = 1024
num_hidden2 = 300
num_hidden3