
Tensorflow
阿拉斯加贵宾蟹
这个作者很懒,什么都没留下…
展开
-
tensorflow使用sparse_to_dense方法出现 indices is out of bounds的错误
tf.sparse_to_dense()方法有时会出现indices out of bounds的情况,比如: import tensorflow as tf # 假设数据标签有3类 label = tf.expand_dims(tf.constant([1, 2, 2, 3, 3]), 1) index = tf.expand_dims(tf.range(5), 1) conact = tf.c...原创 2019-04-01 21:09:19 · 2668 阅读 · 0 评论 -
解决Tensorflow训练模型越到后面计算效率越慢的问题
Session中执行(你的graph).finalize(),如果报错则证明Session在计算过程中不断的向graph中增加结点,导致内存越来越满(GPU memory leak),计算效率降低。 以下面案列为例:batch_ys获取训练样本,batch_ys为样本标签,有0,1,2,3共4个类,tf中需要转换成[[1,0,0,0][0,1,0,0]]格式的标签,用tf.sparse_to_de...原创 2019-04-03 10:02:02 · 2441 阅读 · 0 评论