Fast.ai v3 2019课程中文版笔记


(深度碎片) #3

如何使用Crestle


::Crestle.ai 官网::
* 为深度学习提供轻松无痛的即开即用基础设施.
* 一旦注册成功,你可以在一分钟以内开启携带GPU的notebook做深度学习实验
* 你无需任何安装

::使用指南::
* 下文的使用指南,适用于初次使用者
* 如果不是第一次使用,而是再次登陆跟进工作实验进度,请看直接进入 returning to work 产看相关的Crestle的使用指南

Crestle.ai 为 fast.ai v3 课程提供定制化服务

- 捆绑安装了fast.ai课程所需的所有配置,包括35GB的数据
- 你可以打开notebook直接上手实验,无需做任何杂物工作

价格设定

* Crestle 使用了 AWS [p2.xlarge *spot*](https://aws.amazon.com/ec2/instance-types/p2/) instances 来降低GPU使用成本,通过多地点服务器支持来保障GPU服务供应稳定。
* Crestle的每一个携带GPU的notebook背后都由一个专供的 [NVIDIA Tesla K80 GPU](https://www.nvidia.com/en-us/data-center/tesla-k80/)提供支持
* Crestle的目标是为fast.ai的学生和实践者提供尽可能低的使用成本,目前的定价如下:
	- K80 GPU instance: 每小时0.30 美元, 每秒计价
	- 数据存储: $0 (upto 75 GB) until 12/31/2018以前,75GB以内免费,此后,每月每GB只需0.1美元
	- 首次使用,拥有1小时免费使用时间

步骤 1: 创建crestle.ai账户

* 在这里注册Crestle [here](https://www.crestle.ai/). 
* 在邮箱中点击验证Crestle邮件链接 
* 验证完毕后,可进入Crestle直接使用了

步骤 2: 开启你的Jupyter Notebook

* 一旦登陆,你可以开启你的Jupyter notebook
* 只有当你开启Jupyter notebook时,你才会被计费

步骤 3: 前往 fast.ai 课程

* 一旦开启携带GPU的notebook,你的GUP会在一分钟内就绪
* fast.ai课程设置已经到位,你可直接根据下面的文件结构前往课程
- courses
     - fast-ai
        - course-v3

步骤 4: 更新 the fastai library 库

* 在开始实验之前,你需要先更新fastai library
* 为此,我们需要开启terminal 
* 点击 New, 点击 Terminal, 完成开启
* ![](&&&SFLOCALFILEPATH&&&763FF91A-3661-4CED-927D-DF4888844A5B.png)
* 在跳出的Terminal 窗口中输入:
conda update conda
conda install -c fastai fastai
* 最后关闭 terminal 窗口

步骤 5: 数据早已到位,直接写代码就行

* 课程所需的数据 [datasets](https://course.fast.ai/datasets) 已经就位,35GB的数据随时准备用来训练模型,无需下载. 

* 你可以前往相关课程notebook开始实验

步骤 6: 当你结束时务必关闭the instance

* 为了避免GPU空转计费,务必stop the instance,关闭键在最上方. 
* 你可以随时重新开启GPU,如步骤2所示
* 关闭你的instance时,模型会自动备份,下次可以接着使用

Crestle为我们安装了什么?

* 安装了全套的 [full Anaconda 5.3.0 Python environment](https://repo.anaconda.com/archive/) 
* 此外还安装了fast.ai所需的环境 [here](https://github.com/fastai/fastai#conda-install) ,包括Pytorch with GPU 支持 与 fastai library.
* 你也可以从Notebook里打开Terminal,通过 `conda install` or even `pip install`直接安装库或软件到你的home directory
* 当你关闭instance时,所有库都会自动备份

存储与数据

* Crestle.ai 为你提供 75GB 存储空间.
* 其中37GB被fast.ai课程数据和所需环境所占据
* 对这些数据和库,你拥有100%读写权限。你可以前往/home/nbuser 在courses directory and anaconda install directory (hidden directory) 查看
* 你添加到home directory下的内容都会免费备份

Crestle.ai与crestle.com有何不同?

* 是crestle.com的新版本
* 为fast.ai v3 定制
* 更快更便宜

去哪里寻求帮助

* 发送邮件到 support@crestle.com 

谁创建和支持Crestle?

* crestle.com was created by [Anurag Goel](https://twitter.com/anuraggoel) 
* and is now being supported and managed by [doc.ai](https://doc.ai/).

Where can I learn more about Crestle?

Please read our FAQ. Our pricing information is listed here. You can always reach out to us at support@crestle.com.


📝 Deep Learning Lesson 1 Notes
(Jeremy Howard (Admin)) #4

谢谢您给我们写非常好的中文版笔记 :grinning:

(Any volunteers to help translate the lessons to Chinese?..)


(深度碎片) #5

Thanks @jeremy !

Yes, I want to help more Chinese to study fast.ai too. The following is my attempts.

  • I have done very detailed 7 lesson notes in English and done a lot of ytcropper, and I am incorporating them into the existing forum lesson notes.

  • Meanwhile I started to contribute to English subtitle and Chinese subtitle for 2019 lesson videos on Youtube, but I fear as Machine Translation becomes more and more powerful, any subtitle will be made obsolete soon. So, I am not strongly motivated to work on English and Chinese subtitles. Maybe I am wrong about this, what’s your opinion?

  • I am experienced in making short study note video series on ML and DL courses. I have done Ng’s ML and DL courses study-notes-videos in Chinese. Although Ng’s videos are wonderful and extremely friendly, still lots of people appreciate and consider my study note videos to be good complement with original videos with Chinese subtitles. So, my current plan is to turn the forum incorporated lesson notes into a long series of short videos in Chinese, and I will post the video links here.

Of course, I will provide the Chinese version of lesson notes here too.

Will my plan of work violate any rules of fast.ai?
When the study note videos are done and posted, how can I give credit to fast.ai and people on forum formally and correctly?

Thanks!


(深度碎片) #6

重回 Crestle.ai


继续Notebook实验,仅需一下步骤

1. 启动你的GPU instance
2. 更新你的课程repository
3. 更新你的 fastai library
4. 实验结束时,关闭GUP instance

启动GPU instance

* 登陆 [Crestle](https://www.crestle.ai/) ,点击 Start Jupyter
* GUP instance需要1-2分钟就绪
* 你之前的实验内容已经准备就绪

更新课程repository

更新课程repository,你需要使用 terminal.
点击 ‘Jupyter Notebook’ 按钮, jupyter notebook 菜单中开启一个新的 terminal

cd courses/fast-ai/course-v3/
git pull

以上步骤讲给你最新的课程notebooks
如果之前你直接修改了课程course-v3/nbs中的notebooks,GitHub会报错
你需要执行 git stash 来删除你之前所做的修改
牢记:你应该始终在复制的notebook 中进行实验工作

更新 fastai library

更新fastai library,需要像之前一样打开 terminal 执行以下代码

conda update conda
conda install -c fastai fastai

停止你的GPU instance

一旦结束实验,请回到控制页面,点击 Stop Jupyter

It’s not enough to just close your browser or turn off your own computer.

从新连接你的GPU instance

步骤大体与之前描述一致

Lesson 2

如果你是新创建的GPU instance,以上操作没问题

如果你之前试验过了,那么这次需要在terminal 中执行: rm -r ~/.datasets/camvid



(深度碎片) #7

0:00-0:47 * ytcropper 可以循环播放
点击前往 fast.ai 官方指南 教你如何开启你的第一个GPU。


(深度碎片) #8

如何问问题

Original English post from Jeremy - Part 1 (2018)

在提问之前

  • 先搜索
  • 再尝试不同关键词搜索

你的问题源于你所面对的环境和困难本身的属性。只有详细全面描述你所处的环境和困难本身,才能帮助回答者更准确的理解你的问题,并给予有帮助的回答。

为此,你需要详细描述以下几点:

  1. 为了解决你的问题,你做了哪些尝试?每个尝试中,你预期有怎样的结果,实际结果是怎样的?视频相关问题,请提供视频链接和时间节点
  2. 你是如何理解问题的?你对问题发生的原因是如何解释的?你认为怎样的解决方案可能解决这个问题?
  3. 你的工作环境配置是怎样的?比如,AWS (p2 or t2?), Paperspace, 你的电脑是PC,OS,Linus…
  4. 如果你没有使用标准的AMIs/scripts,或做了某些修改,请务必指出来
  5. 如果你对工作环境libraries 或者 notebooks做了修改,也必须指出来
  6. 准确给出你收到的错误提示
  7. 如果有必要,提供错误发生时的截图
  8. 如果你在安装或configuration时出现异样(不同于课上展示的),务必指出来
  9. 如果你解决了一部分问题,务必详细描述并告知

(深度碎片) #9

在本地运行课程的Notebook时,如何进行library与notebook更新?

# 如果你在conda environment 下,运行以下代码更新 conda 与 fastai
conda update conda -y # 在 conda env 之外运行,更新conda

git pull # 在 course v3 文件夹下运行,更新notebook

conda install -c fastai fastai # 在conda env 下运行, 更新fastai

(深度碎片) #10

为什么用Jupyter Notebook?

前往练习Jupyter notebook使用
Kaggle中文版Jupyter notebook使用方法将稍后提供

可以说,做深度学习,我们只需要Jupyter Notebook就够了。
在Notebook中我们可以完成任何任务,写代码,编辑文档,作图,图片,表格,等等


(Jeremy Howard (Admin)) #12

I think it’ll be a few more years until automatic translations are good enough that people won’t want manual ones - so I think it would still be very valuable indeed.

Fantastic! That will be great :slight_smile:

There’s no “formal and correct” approach - just a note at the top that your notes are summarizing a fast.ai lesson, along with a link to the lesson, would be a good way for people using your notes to be aware of the source, and access it if they wish.


(深度碎片) #13

The forum post system says I edit too much and only allow to edit again after 3 hours. How can I get around this for working on this particular post intensively? thanks!


(George Zhang) #14

Hey Daniel, forum posts are pretty useful for a live update when the class is still going on. As for completed courses, I would recommend @hiromi’s approach, that is, creating them on Github like this. Note that I am not saying that you should transcript the lecture video word by word like @hiromi, which is a lot of work; (you are my hero, @hiromi) rather, I mean that I would go for Github rather than Discourse forum for collaborating on and sharing lecture notes on completed courses. It is visually more friendly to the reader and allows for better collaboration. Discourse is really not intended for this purpose.

欢迎加入fastai大家庭,感谢你的贡献。


(Hiromi Suenaga) #15

The first time around, I put my notes up in https://medium.com/. It definitely had wider audiences but editing and maintaining was a little difficult because there is no plain markdown text you can access. So for something simple like video URL changing was not as simple as find and replace.

Github approach has been great so far. Actually, @stas created a script utilizing pandoc to export markdown files to PDF for me (https://github.com/hiromis/notes/blob/master/pdf/build/process.txt), so conversion to other format is an added bonus :slight_smile:


(Jeremy Howard (Admin)) #16

I’m afraid I don’t know - we’re using the Discourse forum software, so if you find some setting you’d like me to change, I’m happy to do so.


(深度碎片) #17

Thanks Jeremy, I think I can work it out with github+issues version freely and update on this forum post version once a day.


(深度碎片) #18

Hi @hiromi,
Thanks for your great work and the PDF solution!

I started my notes using your beautiful notes on github. I think I will continue to use your notes as one of my main note sources.

Looking forward to more of your work!


(深度碎片) #19

Thanks @PegasusWithoutWinds for the github suggestion! I am taking it.

Also, you are right that it is wise to consider user experience. I hope my style of using github md + issues is not painful to use.


(George Zhang) #20

Cheers!

For all the amazing posts you have shared above, since these are all md, we should be able to get most of them to work just by copying and pasting. Feel free to start an issue or pull request in https://github.com/fastai/course-v3. We could figure out how to organize them there.

Let me know if there is anything I could help with the docs and website build process. It could be a bit tricky when getting started, but you will find the workflow pretty smooth after getting used to it.


(深度碎片) #21

Thanks @PegasusWithoutWinds, I am sure I will need your help on all these issues mentioned above at some point in the future. At the moment, I have no idea what is necessary to be added onto course v3 repo, given this Chinese version note only just get started.

Right now, I will just try to keep working on this, adding more content, as it progress, many of the issues above may become necessary and I will push them forward with your help.


(Poonam Ligade) #22

There is a limit on number of words you can write in a single discourse post. I remember crossing it for one my my lesson notes and had to truncate it.


#23

非常感谢这个说明