![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
TensorFlow
路漫远吾求索
电子,无线局域网
展开
-
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[5] = 5 is not in [0, 5)原因
错误下面一段代码报错:model = Sequential()# input_dim: 10000个最常见的单词# output_dim: 每个单词的向量维度为8维# input_length: 为文本长度# Embedding 层激活的形状为 (samples, maxlen, 8)model.add(Embedding(len(chars) + 1, 64, input_length=maxlen)) # 将三维的嵌入张量展平成形状为 (samples, maxlen * 8) 的二维原创 2020-12-06 01:41:47 · 4604 阅读 · 3 评论 -
python 中with用法以及with tf.Session(graph = g1) as sess:用法
With用法 以及with tf.Session() as sess用法import osos.environ["TF_CPP_MIN_LOG_LEVEL"]='2' # 只显示 warning 和 Errorimport tensorflow as tfa = tf.constant([1.0,2.0],name = "a")b = tf.constant([2.0, 3.0], ...原创 2019-09-08 20:41:15 · 3428 阅读 · 1 评论