Deleting a branch is permanent. It CANNOT be undone. Continue?
Deleting a branch is permanent. It CANNOT be undone. Continue?
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》
问题所属任务编号(Task 01-05)
task02
运行环境(操作系统版本、Python 版本)/ 非程序问题
macOS M2芯片。电脑本地已安装好anaconda和Jupyter Notebook,配置好pytorch环境,d2l和torch包都装好了,可以用CPU跑李沐老师给的深度学习的代码。想问应该怎么使用GPU进行计算呢?
一定需要NVIDA显卡吗?请教Mac怎么驱动GPU运行呢?
描述你期望看到的结果
Mac本地可以使用GPU进行计算。
谢谢!!
mac m芯片可以使用GPU计算的,只需要重新安装
miniconda
和gpu
版本的Torch
就好,步骤:从 官网 下载
3.9
版本的miniconda
,然后运行:初始化
miniconda
:或者(二选一):
创建虚拟环境
激活虚拟环境
下载
torch-gpu
版本(选)考虑到后续可能需要
gpu
加速训练,因此此处直接下载torch-gpu
版本。Note:检查是否安装成功,首先在命令行输入
python
进入python
编程环境,然后输入若输出结果为
Ture
,则表明安装成功。下载
ipykernel
考虑到书中给的代码运行环境是
jupyter
,应该此处安装ipykernel
,以确保jupyter-notebook
中可以使用刚刚安装的d2l
虚拟环境的内核。Note:
ENVNAME
和DISP-NAME
分别为虚拟环境的名字(此处为
d2l
)和想要显示的名字。为了简便,此处将两个字段都设置为d2l
。原本的Jupyter notebook已经安装和配置好pytorch环境,现需重新安装miniconda 和 gpu 版本的 Torch,
1.请问是不需要进行卸载anaconda等操作、直接从步骤1开始操作吗?anaconda和miniconda会不会冲突
2.原来的Jupyter notebook会被直接覆盖吗?安装完miniconda和gpu版本的Torch之后,再打开Jupyter notebook,那么区别于torch环境的其他环境还能使用吗?之前安装过keras和pygmt环境。
3.配置好Mac GPU之后,电脑本地的计算资源或者算力足够运行多大数据集呢?本地Jupyter Notebook,或者通过colab使用线上算力,哪种更推荐呢?
谢谢~
2.1 不会覆盖,
miniconda
个人认为可以理解为conda
的另一个虚拟环境,每次使用时需要先激活minicnoda环境,即上面提到的conda actiavte ~/miniconda3
,然后再激活你在miniconda
中安装的虚拟环境。2.2 安装完miniconda和gpu版本的Torch之后,再打开Jupyter notebook,默认还是进入原始的内核
kernel
,是不会直接进入虚拟环境的。这时候需要使用最后一步安装ipykernel
将该创建的虚拟环境转为kernel
,然后在jupyter notebook
中选择基于该虚拟环境的内核就好。其他虚拟环境类似操作。