欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Transformers安装及Error解决

程序员文章站 2022-03-26 22:27:23
错误种类:1. 安装速度慢,出现TimeoutError–>解决办法:用镜像2.明明提示安装成功了却在import时说None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.–>原因:tensorflow和transformer...

错误种类:
1. 安装速度慢,出现TimeoutError–>解决办法:用镜像
2.明明提示安装成功了却在import时说None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
–>原因:tensorflow和transformer用了不同的安装方法。例如我的tensorflow是在anaconda prompt装的,但是装transformers却用了cmd
–>解决办法:先把装好的transformers卸载(在cmd中pip uninstall transformers),再打开anaconda prompt重新装一遍)


具体安装方式及代码:
1. 已经安装Anaconda后,打开anaconda prompt
2. 输入pip install -i https://pypi.tuna.tsinghua.edu.cn/simple transformers
3. 检测是否安装成功(例如输入import transformers是否会报错)


就这样~

本文地址:https://blog.****.net/qq_42426451/article/details/112648009