как проверить, использует ли тензор поток оперативной памяти - PullRequest
1 голос
/ 10 июля 2019

Я испытываю что-то странное.Когда я запускаю tensorflow program, он выводит эту информацию перед запуском:

Colocations handled automatically by placer.
2019-07-10 10:36:53.985595: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2019-07-10 10:36:54.011139: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3192000000 Hz
2019-07-10 10:36:54.011914: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x562dbc64bb10 executing computations on platform Host. Devices:
2019-07-10 10:36:54.011928: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>
2019-07-10 10:36:54.113358: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-07-10 10:36:54.114017: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x562dbf2935a0 executing computations on platform CUDA. Devices:
2019-07-10 10:36:54.114028: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): GeForce GTX 1080 Ti, Compute Capability 6.1
2019-07-10 10:36:54.114235: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties: 
name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:01:00.0
totalMemory: 10.91GiB freeMemory: 10.19GiB
2019-07-10 10:36:54.114245: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2019-07-10 10:36:54.115348: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-07-10 10:36:54.115355: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990]      0 
2019-07-10 10:36:54.115359: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0:   N 
2019-07-10 10:36:54.115505: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 9911 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
WARNING:tensorflow:From /home/sgnbx/anaconda3/envs/py3t2/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.

Как вы видите, он говорит:

totalMemory: 10.91GiB freeMemory: 10.19GiB

Однако, когда я проверяю, сколько у меня памятикоманда с помощью этой команды:

 free -g

Я вижу этот вывод:

              total        used        free      shared  buff/cache   available
Mem:             31           5          24           0           1          25
Swap:             0           0           0

Почему тензор потока не имеет доступа ко всей памяти?Возможно, я что-то пропустил, пожалуйста, дайте мне знать.

1 Ответ

1 голос
/ 10 июля 2019

Журнал тензорного потока в строке tensorflow/core/common_runtime/gpu/gpu_device.cc:1433 выводит информацию о вашем графическом процессоре (устройство 0 - также запомните имя исходного файла gpu_device.cc):

2019-07-10 10:36:54.114235: I 
tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with 
properties: 
name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:01:00.0
totalMemory: 10.91GiB freeMemory: 10.19GiB

GeForce GTX 1080 Ti имеет объем памяти 11 ГБ.

Команда free отображает количество свободной и использованной памяти в системе, а не на вашей видеокарте.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...