0
点赞
收藏
分享

微信扫一扫

TypeError: ‘function‘ object is not subscriptable


在tensorflow中使用零矩阵初始化变量的时候出现的:

b = tf.Variable(tf.zeros[1])

这是由于tf.zeros是一个函数,应该有括号,所以应该改为tf.zeros([1])

像这种问题TypeError: 'function' object is not subscriptable

一般都是由于函数没加括号导致的;

更多《计算机视觉与图形学》知识,可关注下方公众号:

TypeError: ‘function‘ object is not subscriptable_Tensorflow

举报

相关推荐

0 条评论