动手学深度学习(PyTorch版)- 【读书活动-心得分享】环境安装
<p><strong><span style="font-size:22px;">深度学习环境的安装</span></strong></p><p> </p>
<p><meta charset="UTF-8" /></p>
<p cid="n4" mdtype="paragraph"><strong>1- 本地安装, 无GPU</strong></p>
<p cid="n12" mdtype="paragraph">安装Anoconda</p>
<p cid="n15" mdtype="paragraph"><code class="hljs">brew install anaconda</code></p>
<p cid="n9" mdtype="paragraph">创建基于本书的环境(先删除,确保从0开始)</p>
<p cid="n19" mdtype="paragraph"><code class="hljs">conda env remove d2l-zh</code></p>
<p cid="n22" mdtype="paragraph">创建环境</p>
<p cid="n28" mdtype="paragraph"><code class="hljs">conda create -n d2l-zh -y python=3.8 pip</code></p>
<p cid="n101" mdtype="paragraph">查看本地环境</p>
<p cid="n104" mdtype="paragraph"><code class="hljs">conda env list</code></p>
<p cid="n109" mdtype="paragraph">初始化环境</p>
<p cid="n112" mdtype="paragraph"><code class="hljs">conda init</code></p>
<p cid="n119" mdtype="paragraph">重启终端</p>
<p cid="n122" mdtype="paragraph"><code class="hljs">source ~/.bash_profile</code></p>
<p cid="n31" mdtype="paragraph">激活环境</p>
<p cid="n34" mdtype="paragraph"><code class="hljs">conda activate d2l-zh</code></p>
<p cid="n41" mdtype="paragraph"> </p>
<p cid="n46" mdtype="paragraph"><meta charset="UTF-8" /> </p>
<p cid="n134" mdtype="paragraph">看老师映射远程服务器的端口到本地的这个操作真的是给我看迷糊了. 不知道到底是什么映射的(虽然我也经常用SSH的命令).</p>
<p cid="n136" mdtype="paragraph"> </p>
<p cid="n131" mdtype="paragraph"> </p>
<p cid="n142" mdtype="paragraph"><strong>2- 安装需要的包</strong></p>
<p cid="n55" mdtype="paragraph"><code class="hljs">pip install jupyter d2l torch torchvision</code></p>
<p cid="n70" mdtype="paragraph"> </p>
<p cid="n60" mdtype="paragraph"><strong>3-下载代码并且运行</strong></p>
<p cid="n73" mdtype="paragraph"><code class="hljs">wget <a href="https://zh-v2.d2l.ai/d2l-zh.zip" target="_blank">https://zh-v2.d2l.ai/d2l-zh.zip</a></code></p>
<p cid="n79" mdtype="paragraph"><code class="hljs">unzip d2l-zh.zip</code></p>
<p cid="n158" mdtype="paragraph">安装rise插件</p>
<p cid="n160" mdtype="paragraph"><code class="hljs">pip install rise</code></p>
<p cid="n165" mdtype="paragraph">运行jupyter</p>
<p cid="n82" mdtype="paragraph"><code class="hljs">jupyter notebook</code></p>
<p cid="n169" mdtype="paragraph"> </p>
<p cid="n85" mdtype="paragraph">安装成功</p>
<p cid="n172" mdtype="paragraph"> </p>
<p>映射远程服务器的端口到本地的这个操作,是有点看不懂啊</p>
页:
[1]