- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2023-05-10T02:25:13+00:00","default:mizutu","mizutu")
[[私的AI研究会]] > Colab
* Google Colaboratory [#z1fcd891]
#ref(colab_s.jpg,right,around,40%,colab_s.jpg)
機械学習や Deep Learning の実行環境に「Google Colaboratory」を使ってみる~
#contents
#clear
RIGHT:&size(12){※ 最終更新:2023/05/10 };
** Google Colaboratory [#f1005ae5]
*** Google Colaboratoryを使ってみる [#q2d16be2]
+ Google の[[「Colaboratory へようこそ」>+https://colab.research.google.com/]]ページを開く~
+ メニューから「ファイル」→「ノートブックを新規作成」を選ぶ~
#ref(20230210_000010_001m.jpg,left,around,20%,20230210_000010_001m.jpg)
#clear
+ コードを入力し「Ctrl」+「Enter」で実行する~
#ref(20230210_000011_001m.jpg,right,around,25%,20230210_000011_001m.jpg)
#codeprettify(){{
print("hello colaboratory!")
}}
入力欄(セル)の下に結果が表示され簡単に Python の実行環境が手に入る~
#clear
*** Google Colaboratoryの実行環境を確認する [#yabd4487]
+ &color(red){GPU を設定する};~
#ref(20230210_000012_001m.jpg,right,around,25%,20230210_000012_001m.jpg)
メニューから「ランタイム」→「ランタイムのタイプを変更」を選ぶ~
#ref(20230210_000013_001s.jpg,right,around,50%,20230210_000013_001s.jpg)
+ 表示されたダイアログから「GPU」を指定する~
~
+ スペックを確認する~
「+コード」を押して、入力欄を追加。コードの先頭に「!」をつけることで、PythonではなくOSのコマンドラインに命令を送ることができる~
・「lshw」をインストールする~
#codeprettify(){{
!apt install lshw
}}
・ハードウェア情報を収集するために「lshw」を実行する~
#codeprettify(){{
!lshw
4d64b99471fa
description: Computer
width: 64 bits
capabilities: smp vsyscall32
*-core
description: Motherboard
physical id: 0
*-memory
description: System memory
physical id: 0
size: 12GiB
*-cpu
product: Intel(R) Xeon(R) CPU @ 2.20GHz
vendor: Intel Corp.
physical id: 1
bus info: cpu@0
width: 64 bits
capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp x86-64 constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat md_clear arch_capabilities
:
*-display
description: 3D controller
product: TU104GL [Tesla T4]
vendor: NVIDIA Corporation
physical id: 4
bus info: pci@0000:00:04.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: msix pm bus_master cap_list
configuration: driver=nvidia latency=0
resources: iomemory:30-2f iomemory:30-2f irq:11 memory:c0000000-c0ffffff memory:380000000-38fffffff memory:390000000-391ffffff
:
}}
●「CPU Intel(R) Xeon(R) 2.20GHz」「メモリ 12GB」「GPU Tesla T4」の実行環境~
#clear
** 更新履歴 [#xb095000]
- 2023/02/22 初版~
#br
* 参考資料 [#z668d3a1]
- [[Colaboratory へようこそ>+https://colab.research.google.com/]]~
- [[Google Colaboratoryの無料GPU環境を使ってみた>+https://www.tdi.co.jp/miso/google-colaboratory-gpu]]~
#br