tensorflow - make_tensor_proto raise ValueError("None values not supported.")
问题描述
我正面临这个例外:
make_tensor_proto 中的文件“/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py”,第 445 行引发 ValueError(“不支持无值。”)
ValueError:不支持任何值。
当我执行这部分代码时:
with tf.variable_scope('{}_discriminator'.format(name), reuse=True):
self.input_x = input_x
#self.input_sequence = tf.placeholder(dtype=tf.float32, shape=[None, None])
self.target_label = tf.placeholder(dtype=tf.int32, shape=[None, output_size])
self.target_weights = tf.placeholder(dtype=tf.float32, shape=[None])
self.z = z
# now declare the weights connecting the input to the hidden layer
self.W1 = tf.Variable(tf.random_normal([input_size, hidden_layer1], stddev=0.01), name='W1')
self.b1 = tf.Variable(tf.random_normal([hidden_layer1]), name='b1')
# and the weights connecting the hidden layer to the output layer
self.W2 = tf.Variable(tf.random_normal([hidden_layer1, output_size], stddev=0.01), name='W2')
self.b2 = tf.Variable(tf.random_normal([output_size]), name='b2')
self.hidden_out = tf.add(tf.matmul(self.input_x, self.W1), self.b1)
self.hidden_out = tf.nn.relu(self.hidden_out)
self.output = tf.nn.softmax(tf.add(tf.matmul(self.hidden_out, self.W2), self.b2))
解决方案
推荐阅读
- python - 巴士票预订系统(简单代码为 .py 文件)
- api - Flutter:接收数据时连接关闭
- webdriver-io - 为什么我不能在我的 wdio.conf.js 文件中使用“导入”?我正在尝试将 HtmlReporter 用于 WebDriverIO
- laravel - Lravel:SoapFault SOAP-ERROR:解析 WSDL:无法从 'http://mydomain.ir/webservice/url/send.php?wsdl' 加载:需要开始标签,'<' 未找到
- python - 在 Python 中的循环内打开绘图
- python - 评估布尔表达式并注释结果
- sql - SQL 中的模式匹配技术可将字符串与关键字正确匹配,但无法获得正确的结果
- php - 在 PHP While 循环中显示/隐藏 Div
- apache-spark - 当 File 大小大于 Spark 中的 Cluster Memory 大小时会发生什么?
- flutter - 如何在本地更改选定的文本颜色 - 颤动