当前位置:网站首页>Some experience of using D2L package and related environment configuration
Some experience of using D2L package and related environment configuration
2022-07-24 05:26:00 【Xinxin vegetation】
One introduction
written :
Beginners of deep learning
Students who lack experience in environmental error troubleshooting
Teacher Li Mu B Station machine learning course ,dive into deep learning Website Students who study for textbooks
following :
All the thunder I stepped on , Also spent a lot of time in troubleshooting mistakes , Gained some experience
I use cpu Version of pytorch
Many pits have been sorted out , Also added some own analysis , I hope I can help you
Two About anaconda Configuration of
1 anaconda Installation process
Be careful
1 It's best to install Do not install directly to c disc ( If c If the disk space is not rich )
Because it will get bigger , By the time I reinstalled the system 50g It's big
2 When installing, add a to the environment variable (add to path) You'd better check , Otherwise, it may be added to the environment variable later , A little bit of trouble
2 d2l Bao He pytorch Package download
1 Create a new environment
It's best not to put all the necessary bags directly in base In the environment
You can create a new environment
Create command :
conda create -n newd2l python=3.7
newd2l : The name of this environment is newd2l , Readers can change
py=3.7 : Created python The version is 3.7
d2l : Here is l It's lowercase l , No 1
Tips : python It is best to 3.7 edition , I installed 3.6 Version of , Some code doesn't work ( Because there are updates ) , debug Long time
example 1 I am 3.6 Received in grad can be implicitly created only for scalar outputs The error of , however 3.7 Can run
example 2 pip install d2l To search the d2l yes 0.17.0 Version of , Not what you need 0.17.5 Version of , There are some incompatibilities
2 Add image source
Why add an image source ?
anaconda Our server is out of the country , The download speed in China is very slow and even the download chain is broken
Using the image source can download faster and more stable
1 . to conda Add image source
According to the path , find This computer - C disc - user - Your account name - .condarc file
If not , Create a new one yourself .condarc file , The file name is empty , Just one .condarc suffix 
Open it in Notepad mode
Copy and paste the following code to set up the image source
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- http://pypi.douban.com/simple/
- defaults
show_channel_urls: true
Here added 3 Image source , You can find another image source and paste it in the above format
If you can't change the suffix
Try the following 
The above settings are applicable conda install command To download the package
2 . to pip Add image source
stay This computer - C disc - user - Your account name Create a folder pip Folder
stay pip Create in a folder pip.ini file 
Notepad mode opens
Assign and paste the following code
[global]
index-url = https://pypi.mirrors.ustc.edu.cn/simple/
extra-index-url = https://pypi.mirrors.ustc.edu.cn/simple/
https://mirrors.aliyun.com/pypi/simple/
https://pypi.tuna.tsinghua.edu.cn/simple/
http://pypi.mirrors.ustc.edu.cn/simple/
https://pypi.org/simple/
trusted-host = pypi.mirrors.ustc.edu.cn
pypi.mirrors.ustc.edu.cn
mirrors.aliyun.com
pypi.tuna.tsinghua.edu.cn
pypi.mirrors.ustc.edu.cn
pypi.org
index-url Is to set the image source Multiple image sources are set above
trusted-host Set up trust for these websites
The above settings are applicable pip install command To download the package
3 . If you are surfing the Internet in science
You can choose Temporarily turn off scientific Internet , If you insist
It also needs to be Setting up a proxy server
1 stay .condarc file Add to
proxy_servers:
http: http://127.0.0.1:7893
https: http://127.0.0.1:7893
ssl_verify: false
Here 7893 Change it to your port name
2 stay pip.info file Add to
proxy = http://127.0.0.1:7893
As shown in the figure below

3 d2l Bao He pytorch Package download
1 open anaconda prompt
2 Switch to directory 2 .2.1 The new environment you created in 
3 Input pip install d2l
And then wait , If you encounter a choice yes or no , Input y , Hit enter
Wait for it to download and install 
Now? d2l 0.17.5 It's already installed
4 pytorch Installation
If you are installing cpu edition Of torch , Input
conda install pytorch torchvision torchaudio cpuonly -c pytorch
that will do 
If you are installing gpu edition Of torch , Step link
https://zh-v2.d2l.ai/chapter_installation/index.html
If you have any questions, please check the comment area and search by yourself
( recommend : gpu More appropriate
I am shy in my pocket , Unable to replace the old computer , No, NVIDIA The graphics card , Helpless use cpu edition )
3 kaggle
Treasure website that provides free computing power
The code on my computer appears due to the version bug But I can't find the reason ,
I temporarily used this website for code running training
How to be in kaggle How to import the required packages ? for example d2l?
Just type in
!pip install d2l
Click on the run , You can do it d2l Download this package 
If you are a computer with low configuration , You can also run the code here 
边栏推荐
- Implementation and comparison of nine sorting (ten thousand words summary)
- Solutions to MySQL remote connection errors
- Text summary acl2021
- BeanShell built-in variable CTX
- 5.模板缓存,绘制一个正方形只能在三角形内移动
- Problems encountered in configuring Yum source
- C语言实现三子棋?五子棋?不,是n子棋
- libevent与多线程
- C语言入门篇 概述
- 力扣、牛客网->链表相关题目(篇一)(c语言)
猜你喜欢
![Embedded system transplantation [2] - Construction of cross development environment](/img/96/8d209c04e41675fc0efaa872c35615.png)
Embedded system transplantation [2] - Construction of cross development environment

Pure white tutorial using Druid database connection pool in idea

scikit-learn笔记

C语言实现扫雷游戏

C语言从入门到入土——函数

T 6-10

VS 调试

FTP file transfer protocol

Implementation and comparison of nine sorting (ten thousand words summary)

Tips for using BeanShell built-in variable prev
随机推荐
JDBC encapsulates a parent class to reduce code duplication
【STL】Map &unordered_map
Learning some contents of vector and iterator
C#进程运行权限
SSM integration
C语言从入门到入土(一)
Tips for using the built-in variable props of BeanShell
C table data De duplication
Embedded system transplantation [2] - Construction of cross development environment
C语言进阶篇 二. 指针
反射
Pointer learning diary (III)
【sklearn】数据预处理
C语言进阶篇 三.字符串函数和内存操作函数
Performance test process
Relationship between sample and population in Statistics: sample success ratio + central limit theorem (sample mean)
DNS domain name resolution service
Detailed explanation of string constant pool and intern() of string
libevent多线程服务端+客户端源码
Learn AI linear regression from Li Mu. The code implementation from scratch is super detailed