Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TensorFlow-20160622

 TensorFlow-20160622

TensorFlow勉強会(4)の発表資料です。
技術書典で頒布する「TensorFlowはじめました」について。

ARIYAMA Keiji

June 22, 2016
Tweet

More Decks by ARIYAMA Keiji

Other Decks in Technology

Transcript

  1. C-LIS CO., LTD.  ༗ࢁܓೋʢ,FJKJ"3*:"."ʣ C-LIS CO., LTD. AndroidΞϓϦ։ൃऀ ػցֶशॳ৺ऀ

    ΍ͬͯ·ͤΜ Photo : Koji MORIGUCHI (AUN CREATIVE FIRM) ͱɺݴ͍ͳ͕Βૣ൒೥……
  2. C-LIS CO., LTD. ໰୊ൃੜ ΦϑΟεͷαʔόʔϚγϯͷ(16͕࢖͑ͳ͘ͳΔ  $ python3 megane_co/cifar10_train.py I

    tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally Filling queue with 400 CIFAR images before starting to train. This will take a few minutes. E tensorflow/stream_executor/cuda/cuda_driver.cc:481] failed call to cuInit: CUDA_ERROR_NO_DEVICE
  3. C-LIS CO., LTD. 5FOTPS'MPXͰ(16͕࢖͑ͳ͍  https://blog.keiji.io/2016/05/cuda_error_no_device.html ֓ཁ ɹGPUϚγϯͰTensorFlowΛ࣮ߦ͢ΔࡍɺCUDA΋cuDNN΋ਖ਼ৗʹηοτΞοϓͰ͖͍ͯ ΔͷʹɺTensorFlow͕GPUΛೝࣝ͠ͳ͍ʢCUDA_ERROR_NO_DEVICE΍No GPU

    devices available on machine.͕දࣔ͞ΕΔʣ৔߹ɺਖ਼͍͠σΟεϓϨΠΧʔυɾυϥΠό͕Πϯε τʔϧ͞Ε͍ͯͳ͍Մೳੑ͕͋Γ·͢ɻ ɹචऀͷ؀ڥͰ͸ɺطଘͷυϥΠόʔΛΞϯΠϯετʔϧʢsudo apt-get remove --purge nvidia*ʣͯ͠ɺNVIDIAͷαΠτ͔ΒυϥΠόʔΛμ΢ϯϩʔυɾΠϯετʔϧ͢Δ͜ͱͰ GPUΛೝࣝ͢ΔΑ͏ʹͳΓ·ͨ͠ɻ
  4. 

  5. 

  6. 

  7. 

  8. 

  9. C-LIS CO., LTD. def _export_graph(sess, epoch): constant_graph_def = graph_util.convert_variables_to_constants( sess,

    sess.graph_def, ["output/logits"]) file_path = os.path.join(FLAGS.graph_dir, 'graph_%02d_epoch.pb' % epoch) with gfile.FastGFile(file_path, 'wb') as f: f.write(constant_graph_def.SerializeToString())  άϥϑʴύϥϝʔλʔ with tf.gfile.FastGFile(graph_file, 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) _ = tf.import_graph_def(graph_def, name='')
  10. C-LIS CO., LTD.  όοναΠζ Every 2.0s: nvidia-smi -l Thu

    Jun 16 17:23:25 2016 Thu Jun 16 17:23:25 2016 +------------------------------------------------------+ | NVIDIA-SMI 361.42 Driver Version: 361.42 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 960 Off | 0000:01:00.0 On | N/A | | 38% 57C P2 34W / 120W | 1916MiB / 2044MiB | 21% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 832 G /usr/bin/X 34MiB | | 0 18183 C python3 1867MiB | +-----------------------------------------------------------------------------+ Thu Jun 16 17:23:30 2016 +------------------------------------------------------+ | NVIDIA-SMI 361.42 Driver Version: 361.42 | |-------------------------------+----------------------+----------------------+
  11. C-LIS CO., LTD.  όοναΠζ Every 2.0s: nvidia-smi -l Fri

    Jun 17 20:40:45 2016 Fri Jun 17 20:40:45 2016 +------------------------------------------------------+ | NVIDIA-SMI 361.42 Driver Version: 361.42 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 960 Off | 0000:01:00.0 On | N/A | | 45% 73C P2 103W / 120W | 1917MiB / 2044MiB | 93% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 832 G /usr/bin/X 34MiB | | 0 24204 C python3 1867MiB | +-----------------------------------------------------------------------------+ Fri Jun 17 20:40:50 2016 +------------------------------------------------------+ | NVIDIA-SMI 361.42 Driver Version: 361.42 | |-------------------------------+----------------------+----------------------+
  12.  ݄̒25೔ʢ౔ʣ ळ༿ݪ ௨ӡձؗ ʰٕज़ॻయʱʹͯ൦෍༧ఆʂ ຊจ64p / ൦෍Ձ֨1,000ԁ https://techbookfest.org/#A-28 TensorFlowͷجૅ

    TensorFlowͱ͸ σʔλϑϩʔάϥϑ ม਺ͱϓϨʔεϗϧμʔ Tensorʢςϯιϧʣ TensorBoardʹΑΔάϥϑͷՄࢹԽ CIFAR-10ͷֶशͱධՁ σʔλͷಡΈࠐΈ ਪ࿦ʢinferenceʣ ֶशʢlearnʣ ධՁʢevaluateʣ σʔλอଘͱϑΟϧλʔͷՄࢹԽ ֶशσʔλͷอଘ ϑΟϧλʔͷՄࢹԽ CIFAR-10ฃಆه ਖ਼نԽ૚Λ௥Ճ͢Δ ܇࿅σʔλΛՃ޻͢Δ υϩοϓΞ΢τΛઃఆ͢Δ VGGNetͷϞσϧΛ࢖͏ ࠷దԽΞϧΰϦζϜΛมߋ͢Δ όοναΠζΛ૿΍͢ TensorFlow͸͡Ί·ͨ͠
 CIFAR-10 ฃಆه