1 安装annaconda:
https://blog.csdn.net/qq_38644840/article/details/97622900
2 创建虚拟环境:
conda create -n env_name python=3.6
# To activate this environment, use:
# > source activate env_name
# To deactivate an active environment, use:
# > source deactivate
3 安装cuda,cudnn:
https://blog.csdn.net/qq_38644840/article/details/102519619
4 安装pytorch,torchvision:
pip install torch torchvision
注意:是pip,不是pip3,因为如果是pip3的话,自动跳到根环境,导致在子环境中import torch出现“no module named torch”
5
# To activate this environment, use
# $ conda activate lea
# To deactivate an active environment, use
# $ conda deactivate
# 删除一个环境
conda env remove -n envname
# 豆瓣源
pip install PyQt5 -i https://pypi.douban.com/simple
2019.12.25问题解决 VQA_ReGAT
1.重建一个虚拟环境
2.按照上面安装cuda/cudnn的方式安装,即安装
conda install cudatoolkit=10.0.130 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda install cudnn=7.6.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
3.在pytorch官网上安装先前版本的pytorch:1.2.0
pip install torch==1.2.0 torchvision==0.4.0
另外:
要把 python3 main.py --config config/butd_vqa.json 改成 python main.py --config config/butd_vqa.json
因为可能,运行python3命令,又跳到根环境当中,所以,要把python3改成python(从pip3改成pip推测)