TinyML
来自Jack's Lab
(版本间的差异)
(→Quick Start) |
(→Quick Start) |
||
第13行: | 第13行: | ||
$ python3 | $ python3 | ||
import tensorflow as tf | import tensorflow as tf | ||
− | hello = tf.constant('Hello, | + | >>> print(tf.__version__) |
− | print(hello) | + | 2.5.0 |
− | + | ||
− | Hello, | + | >>> print('GPU: ', tf.test.is_gpu_available()) |
+ | 2022-04-01 03:24:13.099644: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties: | ||
+ | pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1050 computeCapability: 6.1 | ||
+ | coreClock: 1.493GHz coreCount: 5 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 104.43GiB/s | ||
+ | 2022-04-01 03:24:13.099980: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0 | ||
+ | 2022-04-01 03:24:13.100248: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor with strength 1 edge matrix: | ||
+ | 2022-04-01 03:24:13.100459: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264] 0 | ||
+ | 2022-04-01 03:24:13.100669: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1277] 0: N | ||
+ | 2022-04-01 03:24:13.100967: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1418] Created TensorFlow device (/device:GPU:0 with 2779 MB memory) -> physical G | ||
+ | PU (device: 0, name: NVIDIA GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1) | ||
+ | GPU: True | ||
+ | |||
+ | >>> hello = tf.constant('Hello, Tensorflow!') | ||
+ | >>> print(hello) | ||
+ | tf.Tensor(b'Hello, Tensorflow!', shape=(), dtype=string) | ||
</source> | </source> | ||
<br><br> | <br><br> |
2022年4月1日 (五) 10:25的版本
1 Overview
2 Quick Start
$ pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==2.3.0 $ python3 import tensorflow as tf >>> print(tf.__version__) 2.5.0 >>> print('GPU: ', tf.test.is_gpu_available()) 2022-04-01 03:24:13.099644: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties: pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1050 computeCapability: 6.1 coreClock: 1.493GHz coreCount: 5 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 104.43GiB/s 2022-04-01 03:24:13.099980: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0 2022-04-01 03:24:13.100248: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor with strength 1 edge matrix: 2022-04-01 03:24:13.100459: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264] 0 2022-04-01 03:24:13.100669: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1277] 0: N 2022-04-01 03:24:13.100967: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1418] Created TensorFlow device (/device:GPU:0 with 2779 MB memory) -> physical G PU (device: 0, name: NVIDIA GeForce GTX 1050, pci bus id: 0000:01:00.0, compute capability: 6.1) GPU: True >>> hello = tf.constant('Hello, Tensorflow!') >>> print(hello) tf.Tensor(b'Hello, Tensorflow!', shape=(), dtype=string)