TypeError: 'function' object is not subscriptable
程序员文章站
2024-01-02 11:33:58
...
在tensorflow中使用零矩阵初始化变量的时候出现的:
b = tf.Variable(tf.zeros[1])
这是由于tf.zeros是一个函数,应该有括号,所以应该改为tf.zeros([1])
像这种问题TypeError: 'function' object is not subscriptable
一般都是由于函数没加括号导致的;
推荐阅读
-
TypeError: 'function' object is not subscriptable
-
Fatal error: Call to a member function get() on a non-object
-
Call to a member function on a non-object,分不够再加
-
PHP对象编程有关问题,Call to a member function hello() on a non-object
-
PHP对象编程有关问题,Call to a member function hello() on a non-object
-
js中判断Object、Array、Function等引用类型对象是否相等_javascript技巧
-
Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object
-
Function,Object.creat();
-
d3.svg.line()错误:TypeError: d3.svg.line is not a function
-
Vue 报错TypeError: this.$set is not a function 的解决方法