reduce_sum() got an unexpected keyword argument 'reduction_indices'
时间: 2023-10-15 08:03:01 浏览: 54
这个问题是因为在 TensorFlow 2.0 及以上版本中,reduce_sum() 函数将 reduction_indices 参数更改为 axis 参数。如果您使用的是旧版本的 TensorFlow,则需要使用 reduction_indices 参数来指定要在哪个维度上进行求和操作。但是,在 TensorFlow 2.0 及以上版本中,您应该使用 axis 参数来指定要在哪个轴上进行求和操作。
相关问题
reduce_sum() got an unexpected keyword argument 'aixs'
The error message "reduce_sum() got an unexpected keyword argument 'aixs'" indicates that there is a typo in the code. The correct keyword argument is "axis" instead of "aixs".
You can fix this error by changing the keyword argument "aixs" to "axis" in the function call. For example, if you have a function call like this:
```
tf.reduce_sum(x, aixs=1)
```
You should change it to:
```
tf.reduce_sum(x, axis=1)
```
This will fix the error and the function call should work as expected.
load_model got an unexpected keyword argument 'name
load_model函数是keras中的一个方法,用于加载之前训练好的模型,以便进行预测或继续训练等操作。在使用load_model时,若出现"got an unexpected keyword argument 'name'"的错误提示,通常是因为该函数的调用参数中包括了不被支持的name参数。
解决该问题的方法,一般需要检查代码中load_model的参数传递方式是否正确,是否传递了不必要的关键字参数。如果不确定如何使用该函数,可以查看keras官方文档,文档中详细介绍了该函数的使用方法和支持的参数,可以根据需要进行调整使用。除此之外,还可以通过升级Keras版本、重新安装keras等方式解决该问题。在遇到该问题时,建议充分检查代码和环境等因素,以确保代码正确性和稳定性。