导入wrappers模块出现问题ModuleNotFoundError: No module named ‘keras.wrappers‘

导入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

相关推荐

  1. 解决向MySQL中导入文件中的 数据时出现问题~

    2024-05-11 20:46:03       27 阅读
  2. 后端使用response.reset()导致出现跨域问题

    2024-05-11 20:46:03       54 阅读
  3. 前端模块导入导出方式

    2024-05-11 20:46:03       30 阅读
  4. Easypoi word 模板导出问题

    2024-05-11 20:46:03       56 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-11 20:46:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-11 20:46:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-05-11 20:46:03       82 阅读
  4. Python语言-面向对象

    2024-05-11 20:46:03       91 阅读

热门阅读

  1. 力扣:763. 划分字母区间

    2024-05-11 20:46:03       63 阅读
  2. 算法学习笔记(博弈论中的SG函数)

    2024-05-11 20:46:03       70 阅读
  3. LVS(Linux Virtual Server)知识点详解

    2024-05-11 20:46:03       26 阅读
  4. Nginx - location 指令(二)

    2024-05-11 20:46:03       34 阅读
  5. Linux监听某个进程,自动重启

    2024-05-11 20:46:03       29 阅读
  6. 数据字典是什么?

    2024-05-11 20:46:03       35 阅读