Cloud Computing with FloydHub

Create an account

Install floyd-cli on computer with dependency of python.

pip install -U floyd-cli

Installing...

steriowang:~ sterio$ pip install -U floyd-cli
Collecting floyd-cli
  Downloading floyd-cli-0.10.9.tar.gz
Requirement already up-to-date: click>=6.7 in ./anaconda3/lib/python3.6/site-packages (from floyd-cli)
Collecting clint>=0.5.1 (from floyd-cli)
  Downloading clint-0.5.1.tar.gz
Collecting requests>=2.12.4 (from floyd-cli)
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
    100% |████████████████████████████████| 92kB 31kB/s 
Collecting requests-toolbelt>=0.7.1 (from floyd-cli)
  Downloading requests_toolbelt-0.8.0-py2.py3-none-any.whl (54kB)
    100% |████████████████████████████████| 61kB 36kB/s 
Collecting marshmallow>=2.11.1 (from floyd-cli)
  Downloading marshmallow-2.13.6-py2.py3-none-any.whl (45kB)
    100% |████████████████████████████████| 51kB 85kB/s 
Requirement already up-to-date: pytz>=2016.10 in ./anaconda3/lib/python3.6/site-packages (from floyd-cli)
Collecting shortuuid>=0.4.3 (from floyd-cli)
  Downloading shortuuid-0.5.0.tar.gz
Collecting tabulate>=0.7.7 (from floyd-cli)
  Downloading tabulate-0.7.7-py2.py3-none-any.whl
Collecting pathlib2>=2.2.1 (from floyd-cli)
  Downloading pathlib2-2.3.0-py2.py3-none-any.whl
Collecting args (from clint>=0.5.1->floyd-cli)
  Downloading args-0.1.0.tar.gz
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.12.4->floyd-cli)
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 58kB/s 
Collecting urllib3<1.23,>=1.21.1 (from requests>=2.12.4->floyd-cli)
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
    100% |████████████████████████████████| 133kB 71kB/s 
Collecting idna<2.7,>=2.5 (from requests>=2.12.4->floyd-cli)
  Downloading idna-2.6-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 93kB/s 
Collecting certifi>=2017.4.17 (from requests>=2.12.4->floyd-cli)
  Downloading certifi-2017.7.27.1-py2.py3-none-any.whl (349kB)
    100% |████████████████████████████████| 358kB 172kB/s 
Collecting six (from pathlib2>=2.2.1->floyd-cli)
  Downloading six-1.11.0-py2.py3-none-any.whl
Building wheels for collected packages: floyd-cli, clint, shortuuid, args
  Running setup.py bdist_wheel for floyd-cli ... done
  Stored in directory: /Users/sterio/Library/Caches/pip/wheels/27/5e/b8/75d2e8df1a67c9a72a90d133bd565a86d8a48af0b0527215ed
  Running setup.py bdist_wheel for clint ... done
  Stored in directory: /Users/sterio/Library/Caches/pip/wheels/aa/65/4a/a0bceb0a6bee518b1dace4c803f24c4ac8febe55bdca0f14ed
  Running setup.py bdist_wheel for shortuuid ... done
  Stored in directory: /Users/sterio/Library/Caches/pip/wheels/0b/50/5e/fae6e070b59ef891e16b518376682f9b084491c1832b99cc34
  Running setup.py bdist_wheel for args ... done
  Stored in directory: /Users/sterio/Library/Caches/pip/wheels/0a/e0/66/35419f9f9ee41099a3631f0f308b9604bd1ffeabc066d69070
Successfully built floyd-cli clint shortuuid args
Installing collected packages: args, clint, chardet, urllib3, idna, certifi, requests, requests-toolbelt, marshmallow, shortuuid, tabulate, six, pathlib2, floyd-cli
  Found existing installation: chardet 2.3.0
    Uninstalling chardet-2.3.0:
      Successfully uninstalled chardet-2.3.0
  Found existing installation: idna 2.2
    Uninstalling idna-2.2:
      Successfully uninstalled idna-2.2
  Found existing installation: requests 2.13.0
    Uninstalling requests-2.13.0:
      Successfully uninstalled requests-2.13.0
  Found existing installation: six 1.10.0
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.10.0:
      Successfully uninstalled six-1.10.0
  Found existing installation: pathlib2 2.2.0
    Uninstalling pathlib2-2.2.0:
      Successfully uninstalled pathlib2-2.2.0
Successfully installed args-0.1.0 certifi-2017.7.27.1 chardet-3.0.4 clint-0.5.1 floyd-cli-0.10.9 idna-2.6 marshmallow-2.13.6 pathlib2-2.3.0 requests-2.18.4 requests-toolbelt-0.8.0 shortuuid-0.5.0 six-1.11.0 tabulate-0.7.7 urllib3-1.22

Login in to FloydHub through floyd-cli

login with floyd login command and copy token into terminal

steriowang:~ sterio$ floyd login
Authentication token page will now open in your browser. Continue? [Y/n]: y
Please copy and paste the authentication token.
This is an invisible field. Paste token and press ENTER: 
Login Successful
CLI authentication

Get code from Github with git clone + github repository url

steriowang:~ sterio$ git clone https://github.com/sterio-wang/Udacity-dlnd-image-classification-with-CIFAR-10-dataset
Cloning into 'Udacity-dlnd-image-classification-with-CIFAR-10-dataset'...
remote: Counting objects: 13, done.
remote: Total 13 (delta 0), reused 0 (delta 0), pack-reused 13
Unpacking objects: 100% (13/13), done.

cd cd + project nameand list all files with ls command in that repository

steriowang:~ sterio$ cd Udacity-dlnd-image-classification-with-CIFAR-10-dataset
steriowang:Udacity-dlnd-image-classification-with-CIFAR-10-dataset sterio$ ls
README.md           helper.py
dlnd_image_classification.html  problem_unittests.py
dlnd_image_classification.ipynb
steriowang:Udacity-dlnd-image-classification-with-CIFAR-10-dataset sterio$ 

It contains 5 files:

  • README.md
  • helper.py
  • dlnd_image_classification.html
  • problem_unittests.py
  • dlnd_image_classification.ipynb

Initialize selected project

Take jupyter notebook mode as example. Firstly initialize selected project byfloyd init + project name. Then run

$ floyd run --mode jupyter --gpu --env tensorflow

It will execute 4 things behind:

steriowang:Udacity-dlnd-image-classification-with-CIFAR-10-dataset sterio$ floyd run --mode jupyter --gpu --env tensorflow
Creating project run. Total upload size: 536.9KiB
Syncing code ...
[================================] 551280/551280 - 00:00:04

JOB NAME
-------------------------------------------------------------------------
sterio/projects/udacity-dlnd-image-classification-with-cifar-10-dataset/1

Setting up your instance and waiting for Jupyter notebook to become available ......

Path to jupyter notebook: https://www.floydhub.com/notebooks/vhiz2KgzPM8snPvi9MRqB2
  • Sync your local code to FloydHub's server
  • Provision a GPU instance on the cloud (if you want CPU, drop the --gpu flag)floyd run --mode jupyter --env tensorflow
  • Set up an deep learning environment with TensorFlow installed (because --env tensorflow)
  • Start a Jupyter server on the cloud, and open the url in your browser as:
Floyd Jupyter Server

After jupyter server page pops up then you can open and run the ipynb cell by cell just like running locally. It's recommended to use GPU for efficiency. Here is the output of my project: https://www.floydhub.com/notebooks/T4wUwkxFLHLebC4YkxUa8i/notebooks/dlnd_image_classification.ipynb

Supplementary

  • Monitor project status by command floyd status
steriowang:Udacity-dlnd-image-classification-with-CIFAR-10-dataset sterio$ floyd status
JOB NAME                                                                   CREATED        STATUS      DURATION(s)  INSTANCE    DESCRIPTION
-------------------------------------------------------------------------  -------------  --------  -------------  ----------  -------------
sterio/projects/udacity-dlnd-image-classification-with-cifar-10-dataset/5  8 minutes ago  running               0  g1
  • Delete a job by command floyd delete job name or Web UI
steriowang:Udacity-dlnd-image-classification-with-CIFAR-10-dataset sterio$ floyd delete sterio/projects/udacity-dlnd-image-classification-with-cifar-10-dataset/5
Delete Run: sterio/projects/udacity-dlnd-image-classification-with-cifar-10-dataset/5? [y/N]: y
Job HPLamsSwAyj7fNgh6YXdtH: Deleted
steriowang:Udacity-dlnd-image-classification-with-CIFAR-10-dataset sterio$ 
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,445评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,889评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,047评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,760评论 1 276
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,745评论 5 367
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,638评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,011评论 3 398
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,669评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,923评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,655评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,740评论 1 330
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,406评论 4 320
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,995评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,961评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,197评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,023评论 2 350
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,483评论 2 342

推荐阅读更多精彩内容

  • 大雨阻挡我前行的路, 我可否在此处为这雨高歌。 生活在诉说着迷途, 不能束缚我脚步。
    风淋湿了你阅读 199评论 0 0
  • 回到酒店,刚出电梯,听到走廊上有个小男孩在放声大哭。我皱了皱眉头。才刚刚八点,在公共场合如此吵闹,想必会影响很多客...
    河之洲hz阅读 158评论 3 0
  • 自从上了三中心课程后,自以为情感充沛的我才发现原来自己是个情感压制的人,但今早一件温暖的事情我试图记录下来,...
    小菲她三姐阅读 309评论 0 2
  • 推荐此书,此书是我最喜欢的五书之一,喜欢程度:排名第二。 这本书说的是: 盘古世界,黄龙真人因突破失败,穿越到异界...
    鹿也野阅读 635评论 0 0