当前位置: 首页 > article >正文

AttributeError: ‘FieldInfo‘ object has no attribute ‘required‘.

诸神缄默不语-个人CSDN博文目录

这个bug是在安装doccano包之后,在运行transformers代码时出现的。

核心报错信息:

RuntimeError: Failed to import transformers.models.bert.modeling_bert because of the following error (look up to see its traceback):
'FieldInfo' object has no attribute 'required'

这个是因为pydantic包>=2.0.0了,解决方案是安装比较老的版本,我的选择是pip install pydantic==1.10.13
但是这样就又跟doccano冲突了,建议是把doccano安装到别的环境里。

参考资料:

  1. https://pypi.org/project/pydantic/#history
  2. [BUG] Attribute error when importing DeepSpeed Engine · Issue #3963 · microsoft/DeepSpeed

http://www.kler.cn/a/157835.html

相关文章:

  • 头歌—密码学基础
  • Java系列-ArrayList源码
  • svn服务端安装
  • php获取本年、本月、本周时间戳和日期格式(2020)
  • 为什么每天都要做晨会?揭秘研发团队的默契背后
  • 【android开发-07】android中ImageView的用法介绍
  • 浪涌保护器参数指南:浪涌保护器行业选型方案
  • xampp环境安装
  • Visual Studio2022创建Windows服务程序
  • Ubuntu环境下使用nginx实现强制下载静态资源
  • c++ 执行系统命令system 、popen
  • 使用Python Flask搭建Web问答应用程序并发布到公网远程访问
  • 快速学习PyQt5的高级自定义控件
  • 25.Python 网络编程:TCP和UDP编程
  • python-批量调整指定目录下所有图片文件的大小
  • uniapp-hubildx配置
  • 《消息队列MyMQ》——参考RabbitMQ实现
  • leetcode做题笔记1038. 从二叉搜索树到更大和树
  • 聊聊 Jetpack Compose 的 “状态订阅自动刷新” -- mutableStateListOf
  • 25、pytest的测试报告插件allure