• <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 閱讀(3603) 評(píng)論(1)  編輯 收藏 引用 所屬分類: life關(guān)于人工智能的yy

            評(píng)論:
            # re: Deep Learning (Spark, Caffe, GPU) 2015-10-21 18:19 | 春秋十二月
            這是啥  回復(fù)  更多評(píng)論
              
            狠狠色综合久久久久尤物| 国产精品久久新婚兰兰| 久久亚洲AV成人出白浆无码国产| 麻豆av久久av盛宴av| 国产精品99久久久精品无码| 久久91精品国产91久久麻豆| 久久久噜噜噜久久| 久久A级毛片免费观看| 欧美激情精品久久久久久久九九九 | 日本久久久久久中文字幕| 一级做a爰片久久毛片毛片| 成人国内精品久久久久一区| 色悠久久久久久久综合网| 国产精品久久久久9999高清| 亚洲AⅤ优女AV综合久久久| 久久亚洲私人国产精品vA| 9191精品国产免费久久| 久久婷婷五月综合97色| 欧美与黑人午夜性猛交久久久| 欧美噜噜久久久XXX| 亚洲天堂久久久| 久久综合色区| 麻豆精品久久精品色综合| 久久久久久久亚洲Av无码| 久久精品桃花综合| 久久乐国产精品亚洲综合| 亚洲国产成人久久综合碰碰动漫3d| 亚洲伊人久久大香线蕉综合图片| 久久无码国产| 日日狠狠久久偷偷色综合0| 久久国产精品一区| 天天做夜夜做久久做狠狠| 91亚洲国产成人久久精品| 国产精品久久久久9999| 久久免费视频观看| 久久精品国产免费| 亚洲国产精品久久| 久久狠狠一本精品综合网| 国产无套内射久久久国产| 亚洲人成电影网站久久| 久久久噜噜噜久久中文字幕色伊伊 |