菜鸟赫本 2023-04-06 17:58 采纳率: 82.1%
浏览 83
已结题

bert模型训练时sklearn.__check_build._check_build问题

bert模型训练sklearn.__check_build._check_build报错
报错:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\test_4_6\lib\site-packages\sklearn\__check_build\__init__.py", line 44, in <module>
    from ._check_build import check_build  # noqa
ModuleNotFoundError: No module named 'sklearn.__check_build._check_build'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/data/代码/代码/Bert文本分类/run.py", line 8, in <module>
    from train_eval import train, init_network
  File "D:\data\代码\代码\Bert文本分类\train_eval.py", line 6, in <module>
    from sklearn import metrics
  File "C:\ProgramData\Anaconda3\envs\test_4_6\lib\site-packages\sklearn\__init__.py", line 81, in <module>
    from . import __check_build  # noqa: F401
  File "C:\ProgramData\Anaconda3\envs\test_4_6\lib\site-packages\sklearn\__check_build\__init__.py", line 46, in <module>
    raise_build_error(e)
  File "C:\ProgramData\Anaconda3\envs\test_4_6\lib\site-packages\sklearn\__check_build\__init__.py", line 31, in raise_build_error
    raise ImportError("""%s
ImportError: No module named 'sklearn.__check_build._check_build'
___________________________________________________________________________
Contents of C:\ProgramData\Anaconda3\envs\test_4_6\lib\site-packages\sklearn\__check_build:
setup.py                  _check_build.cp36-win_amd64.pyd__init__.py
__pycache__
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.

If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.

If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.

Process finished with exit code 1

重新下载安装过相关的库但是还是无法解决
相关库版本:

```python

scikit-learn --0.24.2
scipy --1.5.4
numpy --1.20.1
sklearn --0.0
python --3.8.8

```

  • 写回答

3条回答 默认 最新

  • herosunly Python领域优质创作者 2023-04-06 18:10
    关注

    试试以下命令

    pip uninstall sklearn
    pip install numpy scipy
    pip install scikit-learn
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 4月15日
  • 已采纳回答 4月7日
  • 修改了问题 4月7日
  • 修改了问题 4月6日
  • 展开全部

悬赏问题

  • ¥30 logisim中设计一个位于十字路口的交通信号灯控制系统
  • ¥15 DispatcherServlet.noHandlerFound No mapping found for HTTP request with URI[/untitled30_war_e
  • ¥15 使用deepspeed训练,发现想要训练的参数没有梯度
  • ¥15 寻找一块做为智能割草机的驱动板(标签-stm32|关键词-m3)
  • ¥15 信息管理系统的查找和排序
  • ¥15 基于STM32,电机驱动模块为L298N,四路运放电磁传感器,三轮智能小车电磁组电磁循迹(两个电机,一个万向轮),怎么用读取的电磁传感器信号表示小车所在的位置
  • ¥15 如何解决y_true和y_predict数据类型不匹配的问题(相关搜索:机器学习)
  • ¥15 PB中矩阵文本型数据的总计问题。
  • ¥15 MATLAB卫星二体模型仿真
  • ¥15 怎么让数码管亮的同时让led执行流水灯代码