CMSG环境配置记录
文章目录
- CMSG环境配置记录
- 其他问题
- 环境修改记录:
- libprotobuf FATAL google/protobuf/stubs/common.cc:83] This program was compiled against version 3.9.2 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.19.4). Contact the program author for an update.
- 关于tf和torch的transformer冲突的问题![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/5817c49dc37ad649392203c4f0d62c70.png)
- RuntimeError: Couldn’t load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.version and your torchvision version with torchvision.version and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.
- 换源
- 服务器下载出错,找不到下载文件位置 requests.exceptions.ConnectionError: HTTPSConnectionPool(host='cdn-lfs.huggingface.co', port=443): Read timed out.
No module named clip (clip环境配置问题) / pip install git+https:XXX 安装失败
直接pip install clip即可解决
环境配置命令:pip install git+https://github.com/jmhessel/pycocoevalcap.git
出错原因:服务器无法链接外网导致
解决方案:在github下载相关的项目,参考一下文章解决方案
-
1.先要下载好原文件(这时候文件夹里往往有一个setup.py文件,但是有些时候并不能简单的python setup.py)
-
2.在下载的文件夹下执行 :python setup.py sdist
-
3.然后会多出一个dist的文件夹,打开文件夹便可以看到一个打包好的你需要安装的项目xxx.tar.gz
-
4.然后再 pip install xxx.tar.gz ,到此安装完成
如果服务器不稳定出错,可以再试几次。
参考链接:https://qdmana.com/2022/02/202202231411368139.html
pip换源安装指定包
命令:pip install -i [国内源] package
例如安装 requests:pip install requests -i https://mirrors.aliyun.com/pypi/simple/
国内源:
清华: https://pypi.tuna.tsinghua.edu.cn/simple
阿里云: https://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学: https://pypi.hustunique.com/
山东理工大学: https://pypi.sdutlinux.org/
豆瓣: https://pypi.douban.com/simple/
参考文献:https://blog.51cto.com/lucas234/4904023
重装PyYAML
亲测可用
pip install --ignore-installed PyYAML
其他问题
list indices must be integers, not unicode
list的索引值必须是整数值
参考链接:https://blog.csdn.net/esa72ya/article/details/88988428
无管理员权限安装软件(unzip为例)
教程:https://blog.csdn.net/Hesy_H/article/details/85333042
添加环境变量
https://blog.csdn.net/luckyyuanyuan/article/details/120235843
环境修改记录:
libprotobuf FATAL google/protobuf/stubs/common.cc:83] This program was compiled against version 3.9.2 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.19.4). Contact the program author for an update.
pip install -Iv protobuf==3.9.2
关于tf和torch的transformer冲突的问题
transformer的init.py文件从if is_tf_available():开始都注释掉
RuntimeError: Couldn’t load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.version and your torchvision version with torchvision.version and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.
原因:清华源安装软件时设置得不好
解决:在pytorch官网下载安装
换源
可以直接在命令行后面加 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
如:pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
服务器下载出错,找不到下载文件位置 requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘cdn-lfs.huggingface.co’, port=443): Read timed out.
首先查看报错代码,根据代码和嵌套函数,找到下载内容,即下载网站,打开网站即可看到下载内容
其次找到在服务器上放置该文件的位置,有两种方法,一种是在代码中找到放置位置,另一种根据前面下载的内容在服务器上find -name 文件名
即可找到相应的位置
手动下载文件再上传到对应位置即可