or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Day 10 : 左手只是輔助 - 用 Google Colab 協助開發日常
程式入門者對程式環境設定一直是個不小的坑與門檻,如果有頻繁在各種桌機、筆電、 OS 系統執行 Python 程式,設定環境費時費力。 Colab 是以雲端網頁呈現的 Python 筆記本形式,類似 Jupyter Notebook,但開啟時其實是幫你開啟一個 Linux 虛擬機,加上可以調用免費 GPU 算力,可以輕鬆達到跨平台使用的目的,也不只是可用於資料科學領域,對於程式日常開發而言也是好幫手。
優缺點比較
如何開啟 Colab 筆記本?
從Google搜尋Colab新增或開啟檔案
colab
關鍵字餵狗(Google)後出現的 Google Colab 即是,歡迎頁面目前已經改為繁體中文介面,或直接依提示視窗選擇用範例、 Google 雲端硬碟、 GitHub 或本機上傳。從 Google 雲端資料夾開啟 Colab
.ipynb
的檔案,就可以用 Colab 服務開啟此筆記本。*.ipynb
檔案,選擇開啟工具,如果先前有「連結」過,就會有「Google Colaboratory」的選項從超連結開啟 Colab
.ipynb
沒有出現像上圖的 Colab 選項,可以進行以下步驟:Colab
並連結 Colab。*ipynb
檔案,很有可能是您本來就尚未登入Google帳戶,請登入即可。常用相關配置
更改為GPU運算
Colab 有意提供 GPU 運算資源給願意投入深度學習領域的開發者,如需使用免費 GPU 資源可依下方式更換。但如果您的程式未用到 GPU 資源,目前 Golab 版本會在右下方提示建議您改回 CPU 運算(當然也可以不改,目前)。
!nvidia-smi
嘿嘿這次要到Tesla P100,以前常開到Tesla K80,Google也有不斷升級超佛心!更改為英文版(選用)
Colab 操作指南
Play
按鍵或Shift + Enter
,執行結果會在程式碼下方顯示。# 大標
、# 次標
,另外您文字 Cell 也可以依照您的標題次序展開/收合。!
+指令
即可,例如!pip install Flask
,並且支援!cp
、!mv
、!git clone
等指令。上傳/下載檔案也可直接在此側分頁操作,或設計按鈕介面在 Colab 的 Cell 供使用者操作(程式碼片段的分頁有範例)。小結
補充更新