TypeError Traceback (most recent call last) <ipython-input-1-26a0454c3f6e> in <module>() ----> 1 import mglearn ~\Anaconda3\lib\site-packages\mglearn\__init__.py in <module>() ----> 1 from . import plots 2 from . import tools 3 from .plots import cm3, cm2 4 from .tools import discrete_scatter 5 from .plot_helpers import ReBl ~\Anaconda3\lib\site-packages\mglearn\plots.py in <module>() 12 from .plot_tree_nonmonotonous import plot_tree_not_monotone 13 from .plot_scaling import plot_scaling ---> 14 from .plot_pca import plot_pca_illustration, plot_pca_whitening, plot_pca_faces 15 from .plot_decomposition import plot_decomposition 16 from .plot_nmf import plot_nmf_illustration, plot_nmf_faces ~\Anaconda3\lib\site-packages\mglearn\plot_pca.py in <module>() 5 from joblib import Memory 6 ----> 7 memory = Memory(cachedir="cache") 8 9 TypeError: __init__() got an unexpected keyword argument 'cachedir'
时间: 2023-06-11 21:07:49 浏览: 150
这个错误可能是因为你正在使用较旧的版本的 joblib 库,而 cachedir 参数是在较新版本中引入的。尝试更新 joblib 库以解决问题。你可以在命令行中使用以下命令更新 joblib 库:
```
pip install -U joblib
```
如果更新后仍然出现问题,则需要检查 mglearn 库是否与其他库版本不兼容,并尝试更新或回滚这些库的版本。
相关问题
TypeError Traceback (most recent call last) <ipython-input-21-656cfe61f5bf> in <module>() 5 epochs=2, 6 validation_split=0.2, ----> 7 shuffle=True) 8 9 TypeError: fit() got an unexpected keyword argument 'batch_size'
这是一个关于 Python 代码中 fit() 函数的 TypeError,可能是由于 fit() 函数没有 batch_size 参数导致的。建议检查一下代码中的 fit() 函数,确认是否有输入正确的参数。如果需要更多的帮助,可以提供更详细的代码和错误信息,我会尽力帮忙解决问题。
TypeError Traceback (most recent call last) <ipython-input-2-b8ec604d943f> in <module>() 1 list1 = [1, 2, 3, 1, 2, 3, 4, 5, 1] ----> 2 list2 = list(set(list1)) 3 print(list2) TypeError: 'list' object is not callable
这个错误的原因是你把一个内置函数 `list()` 的名称赋值给了变量 `list2` ,导致程序无法调用内置函数 `list()` 。你可以尝试使用一个不同的变量名来解决这个问题。以下是一种正确的写法:
```
lst1 = [1, 2, 3, 1, 2, 3, 4, 5, 1]
lst2 = list(set(lst1))
print(lst2)
```
这里我们将变量名 `list1` 改为了 `lst1` ,将变量名 `list2` 改为了 `lst2`。