• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            我要啦免费统计

            from http://docs.continuum.io/anaconda-cluster/examples/spark-caffe

            Deep Learning (Spark, Caffe, GPU)

            Description

            To demonstrate the capability of running a distributed job in PySpark using a GPU, this example uses a neural network library, Caffe. Below is a trivial example of using Caffe on a Spark cluster; although this is redundant, it demonstrates the capability of training neural networks with GPUs.

            For this example, we recommend the use of the AMI ami-2cbf3e44 and the instance type g2.2xlarge. An example profile (to be placed in ~/.acluster/profiles.d/gpu_profile.yaml) is shown below:

            name: gpu_profile
            node_id: ami-2cbf3e44 # Ubuntu 14.04 - IS HVM - Cuda 6.5
            user: ubuntu
            node_type: g2.2xlarge
            num_nodes: 3
            provider: aws
            plugins:
              - spark-yarn
              - notebook
            

            Download

            To execute this example, download the: spark-caffe.py example script or spark-caffe.ipynbexample notebook.

            Installation

            The Spark + YARN plugin can be installed on the cluster using the following command:

            $ acluster install spark-yarn
            

            Once the Spark + YARN plugin is installed, you can view the YARN UI in your browser using the following command:

            $ acluster open yarn
            

            Dependencies

            First, we need to bootstrap Caffe and its dependencies on all of the nodes. We provide a bash script that will install Caffe from source: bootstrap-caffe.sh. The following command can be used to upload the bootstrap-caffe.sh script to all of the nodes and execute it in parallel:

            $ acluster submit bootstrap-caffe.sh --all
            

            After a few minues, Caffe and its dependencies will be installed on the cluster nodes and the job can be started.

            Running the Job

            Here is the complete script to run the Spark + GPU with Caffe example in PySpark:

            # spark-caffe.py from pyspark import SparkConf from pyspark import SparkContext  conf = SparkConf() conf.setMaster('yarn-client') conf.setAppName('spark-caffe') sc = SparkContext(conf=conf)   def noop(x):     import socket     return socket.gethostname()  rdd = sc.parallelize(range(2), 2) hosts = rdd.map(noop).distinct().collect() print hosts   def caffe_process(x):     import os     os.environ['PATH'] = '/usr/local/cuda/bin' + ':' + os.environ['PATH']     os.environ['LD_LIBRARY_PATH'] = '/usr/local/cuda/lib64:/home/ubuntu/pombredanne-https-gitorious.org-mdb-mdb.git-9cc04f604f80/libraries/liblmdb'     import subprocess     proc = subprocess.Popen('cd /home/ubuntu/caffe && bash ./examples/mnist/train_lenet.sh', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)     out, err = proc.communicate()     return proc.returncode, out, err  rdd = sc.parallelize(range(2), 2) ret = rdd.map(caffe_process).distinct().collect() print ret 

            You can submit the script to the Spark cluster using the submit command.

            $ acluster submit spark-caffe.py 

            After the script completes, the trained Caffe model can be found at/home/ubuntu/caffe/examples/mnist/lenet_iter_10000.caffemodel on all of the compute nodes.

            posted on 2015-10-14 17:25 閱讀(3604) 評論(1)  編輯 收藏 引用 所屬分類: life 、關于人工智能的yy

            評論:
            # re: Deep Learning (Spark, Caffe, GPU) 2015-10-21 18:19 | 春秋十二月
            這是啥  回復  更多評論
              
            久久精品国产一区二区 | 99国产精品久久久久久久成人热| 久久丫忘忧草产品| 亚洲欧美日韩中文久久| 久久九九亚洲精品| 亚洲欧美国产精品专区久久| 国产精品久久婷婷六月丁香| 潮喷大喷水系列无码久久精品 | 热re99久久精品国99热| 大蕉久久伊人中文字幕| 狠狠色婷婷久久一区二区三区 | 久久99精品久久久久久噜噜| 久久久国产精品亚洲一区 | 国内精品九九久久久精品| 久久人人爽人人爽人人片AV麻烦| 久久精品国产亚洲网站| 亚洲日韩欧美一区久久久久我 | 无码人妻少妇久久中文字幕蜜桃 | 欧美亚洲国产精品久久| 亚洲欧美日韩精品久久| 精品国产乱码久久久久久郑州公司| 久久狠狠爱亚洲综合影院| 99久久国产综合精品五月天喷水| 欧美牲交A欧牲交aⅴ久久 | 青青草原综合久久大伊人精品| 久久人妻AV中文字幕| 久久婷婷国产麻豆91天堂| 久久精品国产99久久无毒不卡| 无码久久精品国产亚洲Av影片 | 久久青青草原精品国产| 国产午夜精品久久久久免费视 | 国产成人综合久久久久久 | 久久精品国产亚洲av麻豆色欲| 亚洲色大成网站www久久九| 蜜臀av性久久久久蜜臀aⅴ| 综合网日日天干夜夜久久| 久久精品国产亚洲av麻豆蜜芽| 99久久综合国产精品免费| 狠狠色丁香久久婷婷综合_中| 蜜臀久久99精品久久久久久小说| 久久国产精品无码一区二区三区|