TypeError: loop of ufunc does not support argument 0 of type Tensor which has no callable sqrt met
2020-06-06 07:42
2687 查看
使用tensorflow时出现的一错误
- 利用CNN预测时,计算均方根误差报错如下:
cross_entropy = np.sqrt(tf.reduce_mean(tf.reduce_sum(tf.square(ys - prediction), reduction_indices=[1])))
错误如下:
TypeError: loop of ufunc does not support argument 0 of type Tensor which has no callable sqrt met
原因应该是numpy要求输入的是矩阵,输入类型不对,改为:
cross_entropy = tf.sqrt(tf.reduce_mean(tf.reduce_sum(tf.square(ys - prediction), reduction_indices=[1])))
就可以了
相关文章推荐
- Error: The version of SQL Server in use does not support datatype 'datetime2
- ERROR: The version of SQL Server in use does not support datatype 'datetime2'.
- Error: The version of SQL Server in use does not support datatype 'datetime2'
- error: argument of type 'void* (My_Thread::)(void*)' does not match 'void *(*)(void*)'
- theano 中出现 TypeError: 'TensorVariable' object does not support item assignment
- TypeError: object of type 'zip' has no len()、'zip' object is not subscriptable
- [py2neo]TypeError: Neo4j does not support JSON parameters of type int64
- TypeError: object of type 'zip' has no len()、'zip' object is not subscriptable
- Neutron数据库同步错误 NotImplementedError: No support for ALTER of constraints in SQLite dialect
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- Python笔记002——错误TypeError: 'str' does not support the buffer interface
- python初学者大多会遇到的问题TypeError: 'str' object does not support item assignment
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- Error:Could not set unknown property 'supportHotplugComponent' for object of type com.tencent.bugly.
- TypeError: 'str' object does not support item assignment
- This EntitySet of Type 'Data.Tbl_Student' does not support the 'Add' operation.原因
- Neutron数据库同步错误 NotImplementedError: No support for ALTER of constraints in SQLite dialect
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has