Share
Embed
TensorFlow-20160622
TensorFlow勉強会(4)の発表資料です。
技術書典で頒布する「TensorFlowはじめました」について。
ARIYAMA Keiji
June 22, 2016
Transcript
52 slides
-
C-LIS CO., LTD. ༗ࢁܓೋʢ,FJKJ"3*:"."ʣ C-LIS CO., LTD. AndroidΞϓϦ։ൃऀ ػցֶशॳ৺ऀ
ͬͯ·ͤΜ Photo : Koji MORIGUCHI (AUN CREATIVE FIRM) ͱɺݴ͍ͳ͕Βૣ…… -
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 -
C-LIS CO., LTD. 5FOTPS'MPXͰ(16͕͑ͳ͍ https://blog.keiji.io/2016/05/cuda_error_no_device.html ֓ཁ ɹGPUϚγϯͰTensorFlowΛ࣮ߦ͢ΔࡍɺCUDAcuDNNਖ਼ৗʹηοτΞοϓͰ͖͍ͯ ΔͷʹɺTensorFlow͕GPUΛೝࣝ͠ͳ͍ʢCUDA_ERROR_NO_DEVICENo GPU
devices available on machine.͕දࣔ͞ΕΔʣ߹ɺਖ਼͍͠σΟεϓϨΠΧʔυɾυϥΠό͕Πϯε τʔϧ͞Ε͍ͯͳ͍Մೳੑ͕͋Γ·͢ɻ ɹචऀͷڥͰɺطଘͷυϥΠόʔΛΞϯΠϯετʔϧʢsudo apt-get remove --purge nvidia*ʣͯ͠ɺNVIDIAͷαΠτ͔ΒυϥΠόʔΛμϯϩʔυɾΠϯετʔϧ͢Δ͜ͱͰ GPUΛೝࣝ͢ΔΑ͏ʹͳΓ·ͨ͠ɻ -
C-LIS CO., LTD. $*'"3 Ϋϥεྨ ֶशσʔλ ςετσʔλ
IUUQTXXXDTUPSPOUPFEV_LSJ[DJGBSIUNM -
C-LIS CO., LTD. νϡʔτϦΞϧʁ ϞσϧDVEBDPOWOFUϕʔε ΈࠐΈɾϓʔϦϯά̎ ہॴԠਖ਼نԽ શ݁߹̎ %BUB"VHNFOUBUJPOʢΫϦοϓɾࠨӈసɾًɾίϯτϥετʣ ന৭Խʢ8IJUFOJOHʣ
ֶशͱڞ༗ॏΈͷݮਰ ϛχόονֶशʢόοναΠζ γϟοϑϧόονʣ -
C-LIS CO., LTD. ࣮ࡍʹʜʜ 0.10 0.10 0.10 0.10 0.10
0.10 0.10 0.10 0.10 0.74 0.41 -
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='') -
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 | |-------------------------------+----------------------+----------------------+ -
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 | |-------------------------------+----------------------+----------------------+ -
݄̒25ʢʣ ळ༿ݪ ௨ӡձؗ ʰٕज़ॻయʱʹͯ൦༧ఆʂ ຊจ64p / ൦Ձ֨1,000ԁ https://techbookfest.org/#A-28 TensorFlowͷجૅ
TensorFlowͱ σʔλϑϩʔάϥϑ มͱϓϨʔεϗϧμʔ Tensorʢςϯιϧʣ TensorBoardʹΑΔάϥϑͷՄࢹԽ CIFAR-10ͷֶशͱධՁ σʔλͷಡΈࠐΈ ਪʢinferenceʣ ֶशʢlearnʣ ධՁʢevaluateʣ σʔλอଘͱϑΟϧλʔͷՄࢹԽ ֶशσʔλͷอଘ ϑΟϧλʔͷՄࢹԽ CIFAR-10ฃಆه ਖ਼نԽΛՃ͢Δ ܇࿅σʔλΛՃ͢Δ υϩοϓΞτΛઃఆ͢Δ VGGNetͷϞσϧΛ͏ ࠷దԽΞϧΰϦζϜΛมߋ͢Δ όοναΠζΛ૿͢ TensorFlow͡Ί·ͨ͠ CIFAR-10 ฃಆه