Fastai-V3-GCP(Google Cloud Platform) 配置筆記

在 Google Cloud Platform 谷歌云上配置完成之后,咱們就擁有交互式編程筆記 「JupyterNotebook」環(huán)境筒饰,配有 GPU硬件圖形加速器簿透,以調(diào)動(dòng)充分的「算力」抖甘,來(lái)學(xué)習(xí)fast.ai的深度學(xué)習(xí)(煉丹)技術(shù)。

傳送門(mén):fastai 官方 GCP 服務(wù)配置教程

07.09更新:國(guó)內(nèi)朋友可以試試->易學(xué)智能

步驟1:創(chuàng)建你的賬戶(hù)

前往官網(wǎng) https://cloud.google.com/捌治,創(chuàng)建新賬戶(hù)。

價(jià)格與性能

  • 潛在的坑:盡管有 300 美元的初始額度纽窟,但我們需要開(kāi)啟 賬單(Billing)功能肖油,綁定信用卡或借記卡,等候幾個(gè)工作日之后激活它臂港。

Potential roadblock: Even though GCP provides a $300 initial credit, you must enable billing to use it. You can put a credit card or a bank account but the latter will take several days for the activation.

  • 比如森枪,結(jié)算的坑:你在 GoogleClound 里運(yùn)行虛擬鏡像的項(xiàng)目,需要連接至你的賬單賬號(hào)审孽。導(dǎo)航到 billing dashboard县袱,點(diǎn)擊「...」菜單,選擇「更改賬單賬號(hào)」佑力。

The project on which you are going to run the image needs to be linked with your billing account. For this navigate to the billing dashboard, click the ‘’ menu and choose ‘change billing account’.

步驟2:安裝 Google 命令行工具

筆者使用的是 macOS 系統(tǒng)式散,進(jìn)行了如下操作命令:

curl https://sdk.cloud.google.com | bash
exec -l $SHELL

與報(bào)錯(cuò)不期而遇:連接 Google 的 SDK 服務(wù)失敗,端口 443打颤,操作超時(shí)

$ curl https://sdk.cloud.google.com | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:01:15 --:--:--     0curl: (7) Failed to connect to sdk.cloud.google.com port 443: Operation timed out

查看官網(wǎng)文檔
https://cloud.google.com/sdk/docs/quickstart-macos

在準(zhǔn)備工作中的第二條暴拄,赫然寫(xiě)著

確保您的系統(tǒng)上安裝了 Python 2.7:
python -V

$ python -V
Python 3.6.8 :: Anaconda custom (64-bit)

系統(tǒng)反饋漓滔,我當(dāng)前使用的是 Python3.6.8版本

adi0229 (adi0229) ~
$ pyenv virtualenv 2.7.10 my-virtual-env-2.7.10
pyenv-virtualenv: `2.7.10' is not installed in pyenv.

使用pyenv模塊,創(chuàng)建一個(gè) python2.7.x的虛擬環(huán)境乖篷?

$ pyenv install 2.7
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-2.7.tgz...
-> https://www.python.org/ftp/python/2.7/Python-2.7.tgz

警告:Python2.7要在2020年1月時(shí)被“廢黜”响驴。

adi0229 (adi0229) ~
$ pyenv virtualenv 2.7 google-cli
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
pyenv activate <name>
pyenv deactivate
adi0229 (adi0229) ~
$ pyenv activate google-cli
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(google-cli) adi0229 (adi0229) ~

激活所創(chuàng)建的虛擬環(huán)境

(google-cli) adi0229 (adi0229) ~
$ ./google-cloud-sdk/install.sh
Welcome to the Google Cloud SDK!

To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at <https://cloud.google.com/sdk/usage-statistics>. You may choose
to opt out of this collection now (by choosing 'N' at the below prompt), or at
any time in the future by running the following command:

    gcloud config set disable_usage_reporting true

Do you want to help improve the Google Cloud SDK (Y/n)?  y


Your current Cloud SDK version is: 218.0.0
The latest available version is: 231.0.0

┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                   Components                                                   │
├──────────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬───────────┤
│      Status      │                         Name                         │            ID            │    Size   │
├──────────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼───────────┤
│ Update Available │ BigQuery Command Line Tool                           │ bq                       │   < 1 MiB │
│ Update Available │ Cloud SDK Core Libraries                             │ core                     │   9.1 MiB │
│ Update Available │ Cloud Storage Command Line Tool                      │ gsutil                   │   3.6 MiB │
│ Not Installed    │ App Engine Go Extensions                             │ app-engine-go            │  56.4 MiB │
│ Not Installed    │ Cloud Bigtable Command Line Tool                     │ cbt                      │   6.3 MiB │
│ Not Installed    │ Cloud Bigtable Emulator                              │ bigtable                 │   5.6 MiB │
│ Not Installed    │ Cloud Datalab Command Line Tool                      │ datalab                  │   < 1 MiB │
│ Not Installed    │ Cloud Datastore Emulator                             │ cloud-datastore-emulator │  18.4 MiB │
│ Not Installed    │ Cloud Datastore Emulator (Legacy)                    │ gcd-emulator             │  38.1 MiB │
│ Not Installed    │ Cloud Firestore Emulator                             │ cloud-firestore-emulator │  32.2 MiB │
│ Not Installed    │ Cloud Pub/Sub Emulator                               │ pubsub-emulator          │  33.4 MiB │
│ Not Installed    │ Cloud SQL Proxy                                      │ cloud_sql_proxy          │   3.7 MiB │
│ Not Installed    │ Emulator Reverse Proxy                               │ emulator-reverse-proxy   │  14.5 MiB │
│ Not Installed    │ Google Cloud Build Local Builder                     │ cloud-build-local        │   5.9 MiB │
│ Not Installed    │ Google Container Registry's Docker credential helper │ docker-credential-gcr    │   1.8 MiB │
│ Not Installed    │ gcloud Alpha Commands                                │ alpha                    │   < 1 MiB │
│ Not Installed    │ gcloud Beta Commands                                 │ beta                     │   < 1 MiB │
│ Not Installed    │ gcloud app Java Extensions                           │ app-engine-java          │ 107.5 MiB │
│ Not Installed    │ gcloud app PHP Extensions                            │ app-engine-php           │  21.9 MiB │
│ Not Installed    │ gcloud app Python Extensions                         │ app-engine-python        │   6.2 MiB │
│ Not Installed    │ gcloud app Python Extensions (Extra Libraries)       │ app-engine-python-extras │  28.5 MiB │
│ Not Installed    │ kubectl                                              │ kubectl                  │   < 1 MiB │
└──────────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴───────────┘
To install or remove components at your current SDK version [218.0.0], run:
  $ gcloud components install COMPONENT_ID
  $ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [231.0.0], run:
  $ gcloud components update


Modify profile to update your $PATH and enable shell command
completion?

Do you want to continue (Y/n)?  y

The Google Cloud SDK installer will now prompt you to update an rc
file to bring the Google Cloud CLIs into your environment.

Enter a path to an rc file to update, or leave blank to use
[/Users/apple/.bash_profile]:
Backing up [/Users/apple/.bash_profile] to [/Users/apple/.bash_profile.backup].
[/Users/apple/.bash_profile] has been updated.

==> Start a new shell for the changes to take effect.


For more information on how to get started, please visit:
  https://cloud.google.com/sdk/docs/quickstarts

You must log in to continue. Would you like to log in (Y/n)?  y

提示是否繼續(xù)時(shí),輸入 y

https://accounts.google.com/o/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&prompt=select_account&response_type=code&client_id=32555940559.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&access_type=offline

這時(shí)撕蔼,瀏覽器會(huì)自動(dòng)打開(kāi)授權(quán)頁(yè)面踏施,請(qǐng)授權(quán)你的谷歌云平臺(tái)賬號(hào)。

Updates are available for some Cloud SDK components.  To install them,
please run:
  $ gcloud components update

You are logged in as: [jiandi.huang@gmail.com].

Pick cloud project to use:
 [1] aaabbb2429
 [2] aaabbb2477
 [3] aaabbb24788
 [4] aadi0229
 [5] blissful-column-173718
 [6] citric-glow-173718
 [7] cldz-47871703-428d-4c5c-902
 [8] cldz-56c7788c-8547-44f0-bfd
 [9] cldz-bba1b1ea-a00a-4b33-a09
 [10] clouderizer-baseimage
 [11] movie-trail
 [12] Create a new project
Please enter numeric choice or text value (must exactly match list
item):
Project IDs must be 6-30 characters (lowercase ASCII, digits, or
hyphens) in length and start with a lowercase letter. fastai
WARNING: Project creation failed: HttpError accessing <https://cloudresourcemanager.googleapis.com/v1/projects?alt=json>: response: <{'status': '409', 'content-length': '119', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'transfer-encoding': 'chunked', 'vary': 'Origin, X-Origin, Referer', 'server': 'ESF', '-content-encoding': 'gzip', 'cache-control': 'private', 'date': 'Sun, 27 Jan 2019 16:39:11 GMT', 'x-frame-options': 'SAMEORIGIN', 'alt-svc': 'quic=":443"; ma=2592000; v="44,43,39"', 'content-type': 'application/json; charset=UTF-8'}>, content <{
  "error": {
    "code": 409,
    "message": "Requested entity already exists",
    "status": "ALREADY_EXISTS"
  }
}
>
Please make sure to create the project [fastai] using
    $ gcloud projects create fastai
or change to another project using
    $ gcloud config set project <PROJECT ID>
Pick cloud project to use:
 [1] aaabbb2429
 [2] aaabbb2477
 [3] aaabbb24788
 [4] aadi0229
 [5] blissful-column-173718
 [6] citric-glow-173718
 [7] cldz-47871703-428d-4c5c-902
 [8] cldz-56c7788c-8547-44f0-bfd
 [9] cldz-bba1b1ea-a00a-4b33-a09
 [10] clouderizer-baseimage
 [11] fastai-v3-229916
 [12] movie-trail
 [13] Create a new project
Please enter numeric choice or text value (must exactly match list
item):  11

Your current project has been set to: [fastai-v3-229916].

Not setting default zone/region (this feature makes it easier to use
[gcloud compute] by setting an appropriate default value for the
--zone and --region flag).
See https://cloud.google.com/compute/docs/gcloud-compute section on how to set
default compute region and zone manually. If you would like [gcloud init] to be
able to do this for you the next time you run it, make sure the
Compute Engine API is enabled for your project on the
https://console.developers.google.com/apis page.

Created a default .boto configuration file at [/Users/apple/.boto]. See this file and
[https://cloud.google.com/storage/docs/gsutil/commands/config] for more
information about configuring Google Cloud Storage.
Your Google Cloud SDK is configured and ready to use!

* Commands that require authentication will use jiandi.huang@gmail.com by default
* Commands will reference project `fastai-v3-229916` by default
Run `gcloud help config` to learn how to change individual settings

This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
Run `gcloud topic configurations` to learn more.

Some things to try next:

* Run `gcloud --help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.
* Run `gcloud topic -h` to learn about advanced features of the SDK like arg files and output formatting

https://cloud.google.com/compute/docs/gcloud-compute

至此罕邀,谷歌云GCP 的SDK 配置完畢畅形。

步驟3: 創(chuàng)建一個(gè)實(shí)例(Instance)

輸入各種配置指令,比如「IMAGE_FAMILY(鏡像組合)」-> "pytorch-latest-gpu",「ZONE」-> "us-west1-b"等等诉探。最新操作步驟日熬,請(qǐng)移步查閱https://course.fast.ai/start_gcp.html

(google-cli) adi0229 (adi0229) ~
$ gcloud config set compute/zone us-west1-b
Updated property [compute/zone].
(google-cli) adi0229 (adi0229) ~
$ gcloud config set compute/zone ZONE
Updated property [compute/zone].
(google-cli) adi0229 (adi0229) ~
$ gcloud config set compute/zone us-west1-b
Updated property [compute/zone].
(google-cli) adi0229 (adi0229) ~
$ export IMAGE_FAMILY="pytorch-latest-gpu" # or "pytorch-latest-cpu" for non-GPU instances
(google-cli) adi0229 (adi0229) ~
$ export ZONE="us-west2-b" # budget: "us-west1-b"
(google-cli) adi0229 (adi0229) ~
$ export INSTANCE_NAME="my-fastai-instance"
(google-cli) adi0229 (adi0229) ~
$ export INSTANCE_TYPE="n1-highmem-8" # budget: "n1-highmem-4"
(google-cli) adi0229 (adi0229) ~
$
(google-cli) adi0229 (adi0229) ~
$ # budget: 'type=nvidia-tesla-k80,count=1'
(google-cli) adi0229 (adi0229) ~
$ gcloud compute instances create $INSTANCE_NAME \
>         --zone=$ZONE \
>         --image-family=$IMAGE_FAMILY \
>         --image-project=deeplearning-platform-release \
>         --maintenance-policy=TERMINATE \
>         --accelerator="type=nvidia-tesla-p4,count=1" \
>         --machine-type=$INSTANCE_TYPE \
>         --boot-disk-size=200GB \
>         --metadata="install-nvidia-driver=True" \
>         --preemptible
API [compute.googleapis.com] not enabled on project [191131005934].
Would you like to enable and retry (this will take a few minutes)?
(y/N)?
Enabling service compute.googleapis.com on project 191131005934...
ERROR: (gcloud.compute.instances.create) FAILED_PRECONDITION: Operation does not satisfy the following requirements: billing-enabled {Billing must be enabled for activation of service '' in project 'fastai-v3-229916' to proceed., https://console.developers.google.com/project/fastai-v3-229916/settings}

設(shè)置了結(jié)算賬戶(hù)之后,

(google-cli) adi0229 (adi0229) ~
$ export IMAGE_FAMILY="pytorch-latest-gpu" # or "pytorch-latest-cpu" for non-GPU instances
(google-cli) adi0229 (adi0229) ~
$ export ZONE="us-west2-b" # budget: "us-west1-b"
(google-cli) adi0229 (adi0229) ~
$ export INSTANCE_NAME="my-fastai-instance"
(google-cli) adi0229 (adi0229) ~
$ export INSTANCE_TYPE="n1-highmem-8" # budget: "n1-highmem-4"
(google-cli) adi0229 (adi0229) ~
$
(google-cli) adi0229 (adi0229) ~
$ # budget: 'type=nvidia-tesla-k80,count=1'
(google-cli) adi0229 (adi0229) ~
$ gcloud compute instances create $INSTANCE_NAME \
>         --zone=$ZONE \
>         --image-family=$IMAGE_FAMILY \
>         --image-project=deeplearning-platform-release \
>         --maintenance-policy=TERMINATE \
>         --accelerator="type=nvidia-tesla-p4,count=1" \
>         --machine-type=$INSTANCE_TYPE \
>         --boot-disk-size=200GB \
>         --metadata="install-nvidia-driver=True" \
>         --preemptible
API [compute.googleapis.com] not enabled on project [191131005934].
Would you like to enable and retry (this will take a few minutes)?
(y/N)?  y

Enabling service compute.googleapis.com on project 191131005934...
Waiting for async operation operations/acf.5da1affd-33a8-48f4-a1c2-a0aa79b6fc6a to complete...
Operation finished successfully. The following command can describe the Operation details:
 gcloud services operations describe operations/tmo-acf.5da1affd-33a8-48f4-a1c2-a0aa79b6fc6a
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
 - Quota 'GPUS_ALL_REGIONS' exceeded. Limit: 0.0 globally.

(google-cli) adi0229 (adi0229) ~
$
image.png

image.png

步驟3:創(chuàng)建你的示例

再次輸入 CLI 命令行代碼肾胯,創(chuàng)建示例

(google-cli) adi0229 (adi0229) ~
$ export IMAGE_FAMILY="pytorch-latest-gpu" # or "pytorch-latest-cpu" for non-GPU instances
(google-cli) adi0229 (adi0229) ~
$ export ZONE="us-west2-b" # budget: "us-west1-b"
(google-cli) adi0229 (adi0229) ~
$ export INSTANCE_NAME="my-fastai-instance"
(google-cli) adi0229 (adi0229) ~
$ export INSTANCE_TYPE="n1-highmem-8"
(google-cli) adi0229 (adi0229) ~
$ gcloud compute instances create $INSTANCE_NAME \
>         --zone=$ZONE \
>         --image-family=$IMAGE_FAMILY \
>         --image-project=deeplearning-platform-release \
>         --maintenance-policy=TERMINATE \
>         --accelerator="type=nvidia-tesla-p4,count=1" \
>         --machine-type=$INSTANCE_TYPE \
>         --boot-disk-size=200GB \
>         --metadata="install-nvidia-driver=True" \
>         --preemptible

功夫不負(fù)有心人竖席,創(chuàng)建成功。

Created [https://www.googleapis.com/compute/v1/projects/fastai-v3-229916/zones/us-west2-b/instances/my-fastai-instance].
NAME                ZONE        MACHINE_TYPE  PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP    STATUS
my-fastai-instance  us-west2-b  n1-highmem-8  true         10.168.0.2   35.236.103.27  RUNNING
gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME -- -L 8080:localhost:8080

一大串的命令行英文敬肚,非常嚇人毕荐。

$ gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME -- -L 8080:localhost:8080
WARNING: The public SSH key file for gcloud does not exist.
WARNING: The private SSH key file for gcloud does not exist.
WARNING: You do not have an SSH key for gcloud.
WARNING: SSH keygen will be executed to generate a key.
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/apple/.ssh/google_compute_engine.
Your public key has been saved in /Users/apple/.ssh/google_compute_engine.pub.
The key fingerprint is:
SHA256:28o1ycLmw0LnBs/dkPybjH5HDsgl70sFyC3nef1zR1s adi0229@bogon
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|         . o     |
|          + +    |
|          .+.o . |
|        So *o o E|
|      o..+*.oo..+|
|     . B=.*=.+ o+|
|      .+B+.==.o +|
|       o+oo.=+   |
+----[SHA256]-----+
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/apple/.pyenv/versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner
    self.run()
  File "/Users/apple/.pyenv/versions/2.7/lib/python2.7/threading.py", line 483, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/apple/google-cloud-sdk/lib/googlecloudsdk/core/console/progress_tracker.py", line 154, in Ticker
    if self.Tick():
  File "/Users/apple/google-cloud-sdk/lib/googlecloudsdk/core/console/progress_tracker.py", line 226, in Tick
    self._ticks % len(self._symbols.spin_marks)])
  File "/Users/apple/google-cloud-sdk/lib/googlecloudsdk/core/console/progress_tracker.py", line 244, in _Print
    self._console_output.UpdateConsole()
  File "/Users/apple/google-cloud-sdk/lib/googlecloudsdk/core/console/multiline.py", line 154, in UpdateConsole
    self._UpdateConsole()
  File "/Users/apple/google-cloud-sdk/lib/googlecloudsdk/core/console/multiline.py", line 168, in _UpdateConsole
    self._messages[self._last_print_index].Print()
  File "/Users/apple/google-cloud-sdk/lib/googlecloudsdk/core/console/multiline.py", line 280, in Print
    self._WriteLine(line)
  File "/Users/apple/google-cloud-sdk/lib/googlecloudsdk/core/console/multiline.py", line 330, in _WriteLine
    self._stream.write(self._level * INDENTATION_WIDTH * ' ' + line)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u281b' in position 32: ordinal not in range(128)

Updated [https://www.googleapis.com/compute/v1/projects/fastai-v3-229916].
Updating project ssh metadata...done.
Waiting for SSH key to propagate.
Warning: Permanently added 'compute.3388207759647270175' (ECDSA) to the list of known hosts.
======================================
Welcome to the Google Deep Learning VM
======================================

Version: m19
Based on: Debian GNU/Linux 9.7 (stretch) (GNU/Linux 4.9.0-8-amd64 x86_64\n)

Resources:
 * Google Deep Learning Platform StackOverflow: https://stackoverflow.com/questions/tagged/google-dl-platform
 * Google Cloud Documentation: https://cloud.google.com/deep-learning-vm
 * Google Group: https://groups.google.com/forum/#!forum/google-dl-platform

To reinstall Nvidia driver (if needed) run:
sudo /opt/deeplearning/install-driver.sh
This image uses python 3.7 from the Anaconda. Anaconda is installed to:
/opt/anaconda3/

Linux my-fastai-instance 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
jupyter@my-fastai-instance:~$

查看 GPU,型號(hào)是:Tesla P4


jupyter@my-fastai-instance:~$ watch -n 1 nvidia-smi


    self._UpdateConsole()
  File "/Users/apple/google-cloud-sdk/lib/googlecloudsdk/core/console/multiline.py", line 168, in _UpdateConsole
Every 1.0s: nvidia-smi                                                         my-fastai-instance: Thu Jan 31 11:45:56 2019

Thu Jan 31 11:45:56 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.72       Driver Version: 410.72       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla P4            Off  | 00000000:00:04.0 Off |                  N/A |
| N/A   44C    P0    24W /  75W |    621MiB /  7611MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      7834      C   /opt/anaconda3/bin/python                    611MiB |
+-----------------------------------------------------------------------------+

步驟4:接入 fast.ai材料艳馒,更新工具包

cd tutorials/fastai/course-v3
git checkout .
git pull
upyter@my-fastai-instance:~$ cd tutorials/fastai/course-v3
jupyter@my-fastai-instance:~/tutorials/fastai/course-v3$ git checkout .
jupyter@my-fastai-instance:~/tutorials/fastai/course-v3$ git pull
remote: Enumerating objects: 112, done.
remote: Counting objects: 100% (112/112), done.
remote: Total 181 (delta 112), reused 112 (delta 112), pack-reused 69
Receiving objects: 100% (181/181), 78.53 MiB | 37.14 MiB/s, done.
Resolving deltas: 100% (115/115), completed with 30 local objects.
From https://github.com/fastai/course-v3
   89bb13d..72ab579  master     -> origin/master
Updating 89bb13d..72ab579
Fast-forward
 README.md                                                                     |   4 +-
 docs/_data/sidebars/home_sidebar.yml                                          |   9 +-
 docs/css/customstyles.css                                                     |  18 ++-
 docs/datasets.md                                                              |  68 ++++++++++
 docs/deployment_aws_beanstalk.md                                              |   2 +-
 docs/gpu_tutorial.md                                                          |   4 +-
 docs/images/kaggle/fork.png                                                   | Bin 0 -> 123815 bytes
 docs/images/kaggle/homepage.png                                               | Bin 0 -> 244864 bytes
 docs/images/kaggle/landing_page.png                                           | Bin 0 -> 170725 bytes
 docs/images/kaggle/sign_up.png                                                | Bin 0 -> 187383 bytes
 docs/images/kaggle/start_working.png                                          | Bin 0 -> 204760 bytes
 docs/images/kaggle/stop.png                                                   | Bin 0 -> 118468 bytes
 docs/images/kaggle/your_work.png                                              | Bin 0 -> 220391 bytes
 docs/index.md                                                                 |  17 +--
 docs/production/aws-beanstalk.zip                                             | Bin 10028 -> 81089420 bytes
 docs/setup/colab                                                              |  15 +--
 docs/start_aws.md                                                             |   6 +-
 docs/start_colab.md                                                           |  51 ++++----
 docs/start_gcp.md                                                             |  16 ++-
 docs/start_gradient.md                                                        |   5 +-
 docs/start_kaggle.md                                                          |  70 ++++++++++
 docs/static/js/{main.1780dcf1.chunk.js => main.c6652583.chunk.js}             |   4 +-
 docs/static/js/{main.1780dcf1.chunk.js.map => main.c6652583.chunk.js.map}     |   2 +-
 docs/update_kaggle.md                                                         |  43 +++++++
 docs/update_sagemaker.md                                                      |   2 +-
 docs/videos/asset-manifest.json                                               |   6 +-
 docs/videos/index.html                                                        |   2 +-
 ...04e6c6508e113.js => precache-manifest.91d8a87f45992a7dd79e3b201e850386.js} |   8 +-
 docs/videos/service-worker.js                                                 |   2 +-
 files/dl-2019/notes/notes-1-6.md                                              |  22 +++-
 files/dl-2019/notes/notes-1-7.md                                              |  15 ++-
 nbs/dl1/00_notebook_tutorial.ipynb                                            |   4 +-
 nbs/dl1/lesson1-pets.ipynb                                                    |   2 +-
 nbs/dl1/lesson3-imdb.ipynb                                                    | 257 ++++++++++++++++++++++++-------------
 34 files changed, 479 insertions(+), 175 deletions(-)
 create mode 100644 docs/datasets.md
 create mode 100644 docs/images/kaggle/fork.png
 create mode 100644 docs/images/kaggle/homepage.png
 create mode 100644 docs/images/kaggle/landing_page.png
 create mode 100644 docs/images/kaggle/sign_up.png
 create mode 100644 docs/images/kaggle/start_working.png
 create mode 100644 docs/images/kaggle/stop.png
 create mode 100644 docs/images/kaggle/your_work.png
 create mode 100644 docs/start_kaggle.md
 rename docs/static/js/{main.1780dcf1.chunk.js => main.c6652583.chunk.js} (99%)
 rename docs/static/js/{main.1780dcf1.chunk.js.map => main.c6652583.chunk.js.map} (99%)
 create mode 100644 docs/update_kaggle.md
 rename docs/videos/{precache-manifest.edcade663e2c15c437b04e6c6508e113.js => precache-manifest.91d8a87f45992a7dd79e3b201e850386.js} (69%)
upyter@my-fastai-instance:~/tutorials/fastai/course-v3$ sudo /opt/anaconda3/bin/conda install -c fastai fastai
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: /opt/anaconda3

  added / updated specs:
    - fastai


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    bleach-3.1.0               |           py37_0         225 KB
    ------------------------------------------------------------
                                           Total:         225 KB

The following NEW packages will be INSTALLED:

  bleach             pkgs/main/linux-64::bleach-3.1.0-py37_0
  parso              pkgs/main/linux-64::parso-0.3.1-py37_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
bleach-3.1.0         | 225 KB    | ################################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

回到控制臺(tái)憎亚,

adi0229 (adi0229) ~
$ pyenv activate google-cli
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(google-cli) adi0229 (adi0229) ~

步驟5:停止實(shí)例運(yùn)行

參考資料

http://www.reibang.com/p/7d720393fea3
https://course.fast.ai/update_gcp.html
https://course.fast.ai/start_gcp.html

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市弄慰,隨后出現(xiàn)的幾起案子第美,更是在濱河造成了極大的恐慌,老刑警劉巖陆爽,帶你破解...
    沈念sama閱讀 216,591評(píng)論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件什往,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,448評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門(mén)铜幽,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人省古,你說(shuō)我怎么就攤上這事∽心猓” “怎么了衫樊?”我有些...
    開(kāi)封第一講書(shū)人閱讀 162,823評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我科侈,道長(zhǎng)载佳,這世上最難降的妖魔是什么? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,204評(píng)論 1 292
  • 正文 為了忘掉前任臀栈,我火速辦了婚禮蔫慧,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘权薯。我一直安慰自己姑躲,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,228評(píng)論 6 388
  • 文/花漫 我一把揭開(kāi)白布盟蚣。 她就那樣靜靜地躺著黍析,像睡著了一般。 火紅的嫁衣襯著肌膚如雪屎开。 梳的紋絲不亂的頭發(fā)上阐枣,一...
    開(kāi)封第一講書(shū)人閱讀 51,190評(píng)論 1 299
  • 那天,我揣著相機(jī)與錄音奄抽,去河邊找鬼蔼两。 笑死,一個(gè)胖子當(dāng)著我的面吹牛逞度,可吹牛的內(nèi)容都是我干的额划。 我是一名探鬼主播,決...
    沈念sama閱讀 40,078評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼档泽,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼俊戳!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起茁瘦,我...
    開(kāi)封第一講書(shū)人閱讀 38,923評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤品抽,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后甜熔,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,334評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡突倍,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,550評(píng)論 2 333
  • 正文 我和宋清朗相戀三年腔稀,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片羽历。...
    茶點(diǎn)故事閱讀 39,727評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡焊虏,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出秕磷,到底是詐尸還是另有隱情诵闭,我是刑警寧澤,帶...
    沈念sama閱讀 35,428評(píng)論 5 343
  • 正文 年R本政府宣布,位于F島的核電站疏尿,受9級(jí)特大地震影響瘟芝,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜褥琐,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,022評(píng)論 3 326
  • 文/蒙蒙 一锌俱、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧敌呈,春花似錦贸宏、人聲如沸。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,672評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至析显,卻和暖如春鲫咽,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背叫榕。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,826評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工浑侥, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人晰绎。 一個(gè)月前我還...
    沈念sama閱讀 47,734評(píng)論 2 368
  • 正文 我出身青樓寓落,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親荞下。 傳聞我的和親對(duì)象是個(gè)殘疾皇子伶选,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,619評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,322評(píng)論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 9,476評(píng)論 0 23
  • # Awesome Python [![Awesome](https://cdn.rawgit.com/sindr...
    emily_007閱讀 2,210評(píng)論 0 3
  • 版權(quán)聲明: 以下內(nèi)容來(lái)自微信公共帳號(hào)“EOS技術(shù)愛(ài)好者”,搜索“EOSTechLover”即可訂閱尖昏,翻譯Locha...
    Lochaiching閱讀 2,023評(píng)論 0 1
  • 今天仰税,下午放學(xué),便開(kāi)始了抽诉,我們五一小長(zhǎng)假陨簇,一共有四天呢,可是平時(shí)周末的兩倍迹淌,實(shí)在是太好了河绽! 1886年5月1號(hào),芝...
    璀璨貝殼閱讀 182評(píng)論 0 3