导入wrappers出现以下问题:
传统的导入方式为:
from keras.wrappers.scikit_learn import KerasRegressor
出现以下错误:
ModuleNotFoundError Traceback (most recent call last)
Cell In[29], line 1
----> 1 from keras.wrappers.scikit_learn import KerasRegressor
ModuleNotFoundError: No module named 'keras.wrappers'
解决方法:
pip install scikeras
将导入换为下边代码:
from scikeras.wrappers import KerasRegressor
这样就可以正常使用了
我tensorflow的版本为2.13.0
参考链接:https://www.cnblogs.com/mhkj/p/17804528.html