__init__() got an unexpected keyword argument 'n_jobs'什么意思
时间: 2023-10-04 19:06:27 浏览: 157
这个错误通常发生在使用不支持 `n_jobs` 参数的函数时。
`n_jobs` 是指定并行计算的数量,用于加速处理。 如果你在调用一个不支持 `n_jobs` 参数的函数时使用了 `n_jobs` 参数,就会出现 `__init__() got an unexpected keyword argument 'n_jobs'` 这个错误。
解决方法是检查使用的函数是否支持 `n_jobs` 参数,如果不支持就不要使用它。或者使用其他支持 `n_jobs` 参数的函数来实现并行计算。
相关问题
__init__() got an unexpected keyword argument 'n_jobs
This error message is raised when the `__init__()` method of a class is called with an unexpected keyword argument `n_jobs`. This means that the class does not expect to receive the `n_jobs` argument, or it expects it to have a different name.
The `n_jobs` argument is often used in scikit-learn to specify the number of CPU cores to use for parallel processing. If you are encountering this error while using scikit-learn, make sure that you are passing the `n_jobs` argument to a method that expects it, and that you are passing it with the correct name.
If you are encountering this error with your own code, check the documentation or source code of the class you are using to see if it supports the `n_jobs` argument. If it does not, consider using a different class or library that does support parallel processing.
__init__() got an unexpected keyword argument 'n_jobs'
This error message suggests that the function or method you are trying to run does not recognize the parameter `n_jobs`. This parameter is often used to specify the number of parallel jobs to use for computation.
There are a few possible explanations for this error:
1. The code you are running does not support parallel processing and does not have a `n_jobs` parameter. In this case, you would need to modify the code to enable parallel processing or remove the `n_jobs` parameter.
2. The version of the library you are using does not support `n_jobs`. In this case, you may need to update the library to a newer version.
3. There is a typo or other mistake in your code that is causing the error. Double-check your code to make sure that you are passing the `n_jobs` parameter correctly and that it is spelled correctly.
Without more information about the specific code and library you are working with, it is difficult to provide a more specific solution.
阅读全文