在Windows 10系统和GTX 960显卡上成功安装并测试PyTorch的方法
最编程
2024-08-10 09:16:09
...
刚开始深度学习的入门,都推荐在linux环境下搭框架,先入门学习,就还是在windows下试试.
显卡是英伟达 NVIDIA GTX 960M,配置不高
anaconda选择的是 anaconda3
python是3.7.6
下面就是pytorch的安装。
前面的一些过程可以在B站或者其他的教程里找到。
在我进行搭环境时,最烦的是使用conda安装pytorch的缓慢,甚至直接中断,折腾了三四个小时.
后来使用清华镜像源进行安装,流畅舒服,十分钟搞定。
在anaconda的prompt中输入
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
将源换为清华镜像源。
最后运行下面的命令就可以快速安装好
conda install pytorch torchvision cudatoolkit=10.1
不过我在安装完,进行验证时报错: The NVIDIA driver on your system is too old (found version 9020). Please update your GPU driver by downloading and installing a new version from the URL:
这里需要更新显卡驱动
去链接: 显卡驱动.根据自己的显卡系列寻找最新的显卡驱动,只需要找到自己显卡的型号,其他不需要改动,按照提示下载安装显卡驱动。
验证语句
import torch
print(torch.cuda.is_available())
验证语句也是在prompt中如下图:返回true,代表GPU版可用,否则出现错误
推荐阅读
-
在Windows 10系统和GTX 960显卡上成功安装并测试PyTorch的方法
-
【摩尔线程+Colossal-AI强强联手】MusaBert登上CLUE榜单TOP10:技术细节揭秘 - 技术实力:摩尔线程凭借"软硬兼备"的技术底蕴,让MusaBert得以从底层优化到顶层。其内置多功能GPU配备AI加速和并行计算模块,提供了全面的AI与科学计算支持,为AI推理和低资源条件下的大模型训练等场景带来了高效、经济且环保的算力。 - 算法层面亮点:依托Colossal-AI AI大模型开发系统,MusaBert在训练过程中展现出了卓越的并行性能与易用性,特别在预处理阶段对DataLoader进行了优化,适应低资源环境高效处理海量数据。同时,通过精细的建模优化、领域内数据增强以及Adan优化器等手段,挖掘和展示了预训练语言模型出色的语义理解潜力。基于MusaBert,摩尔线程自主研发的MusaSim通过对比学习方法微调,结合百万对标注数据,MusaSim在多个任务如语义相似度、意图识别和情绪分析中均表现出色。 - 数据资源丰富:MusaBert除了自家高质量语义相似数据外,还融合了悟道开源200GB数据、CLUE社区80GB数据,以及浪潮公司提供的1TB高质量数据,保证模型即便在较小规模下仍具备良好性能。 当前,MusaBert已成功应用于摩尔线程的智能客服与数字人项目,并广泛服务于语义相似度、情绪识别、阅读理解与声韵识别等领域。为了降低大模型开发和应用难度,MusaBert及其相关高质量模型代码已在Colossal-AI仓库开源,可快速训练优质中文BERT模型。同时,通过摩尔线程与潞晨科技的深度合作,仅需一张多功能GPU单卡便能高效训练MusaBert或更大规模的GPT2模型,显著降低预训练成本,进一步推动双方在低资源大模型训练领域的共享目标。 MusaBert荣登CLUE榜单TOP10,象征着摩尔线程与潞晨科技联合研发团队在中文预训练研究领域的领先地位。展望未来,双方将携手探索更大规模的自然语言模型研究,充分运用上游数据资源,产出更为强大的模型并开源。持续强化在摩尔线程多功能GPU上的大模型训练能力,特别是在消费级显卡等低资源环境下,致力于降低使用大模型训练的门槛与成本,推动人工智能更加普惠。而潞晨科技作为重要合作伙伴,将继续发挥关键作用。