Transformers installation and error resolution

Types of errors:
1. The installation speed is slow, and TimeoutError appears -> Solution: Use a mirror
. 2. It is clearly indicated that the installation is successful, but it says during 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.
-> Reason: tensorflow and transformer use different installation methods. For example, my tensorflow is installed in the anaconda prompt, but I used cmd to install transformers
-> Solution: first uninstall the installed transformers (in cmd pip uninstall transformers), then open the anaconda prompt and reinstall it again)


Specific installation method and code:
1. After Anaconda has been installed, open the anaconda prompt
2. Enter pip install -i https://pypi.tuna.tsinghua.edu.cn/simple transformers
3. Check whether the installation is successful (for example, import transformerswhether the input will report an error)


That's it~

Guess you like

Origin blog.csdn.net/qq_42426451/article/details/112648009