librosa库出现TypeError: zeros_like() got an unexpected keyword argument 'shape'
时间: 2023-10-05 14:05:00 浏览: 37
这个错误是因为你使用的版本是较老的librosa版本。在较新版本的librosa中,zeros_like()函数不接受shape参数。解决这个问题的方法是升级librosa到最新版本。可以使用如下命令进行升级:
pip install --upgrade librosa
升级完毕后,再次运行程序即可。
相关问题
TypeError: zeros() got an unexpected keyword argument 'dtype1'
这错误是因为在调用`zeros()`函数时使用了一个不存在的参数`dtype1`。正确的参数应该是`dtype`。
例如,如果您想要创建一个包含5个元素的浮点数数组,可以使用以下代码:
```
import numpy as np
arr = np.zeros(5, dtype=float)
```
注意,`dtype`参数可以省略,默认为`float64`。如果您要创建整数数组,可以将`dtype`设置为`int`或`int32`等等。
TypeError: __init__() got an unexpected keyword argument 'degradation'
根据提供的引用内容,出现了两个不同的错误:TypeError: __init__() got an unexpected keyword argument 'autocompletion' 和 TypeError: init() got an unexpected keyword argument 'indices'。这两个错误都是因为在调用函数时传递了不支持的参数导致的。
如果出现了类似的错误TypeError: __init__() got an unexpected keyword argument 'degradation',则说明在调用某个函数时传递了不支持的参数'degradation'。解决这个问题的方法是检查代码中是否有拼写错误或者参数名错误,并确保传递的参数是函数支持的。
如果确定传递的参数是正确的,但仍然出现了这个错误,则可能是因为使用的库版本过低或者过高导致的。可以尝试更新或降低库的版本来解决这个问题。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)