"DenseToSparseBatchDataset" device_type:"CPU" 对于未知操作:DenseToSparseBatchDataset

"DenseToSparseBatchDataset" device_type: "CPU" for unknown op: DenseToSparseBatchDataset

经过大量调整后,tensorflow 从源代码构建并安装到 Python 3.5(它似乎不喜欢 3.6),现在 Keras 程序在笔记本中运行,没有像以前那样从 tensorflow 抱怨,有些东西没有按照标准安装。但是,它似乎确实大量使用了 CPU:

和GPU轻轻的:

$ nvidia-smi
Fri Nov 10 18:13:11 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.26                 Driver Version: 375.26                    |
|-------------------------------+----------------------+----------------------+
| 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 105...  Off  | 0000:01:00.0      On |                  N/A |
|  0%   49C    P0    36W /  72W |   3740MiB /  4030MiB |     28%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0      2283    G   /usr/lib/xorg/Xorg                             273MiB |
|    0      3411    G   cinnamon                                       155MiB |
|    0     14388    C   /storageHDD/tensorflow/bin/python3            3307MiB |
+-----------------------------------------------------------------------------+

从 jupyter 内核输出中的消息来看,它似乎有意识地决定使用 CPU 而不是 GPU:

[I 17:20:45.588 NotebookApp] Adapting to protocol v5.1 for kernel a3c0afcc-e525-48e5-8f54-75a349214f96
2017-11-10 17:20:50.857309: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:900] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-11-10 17:20:50.857625: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1061] Found device 0 with properties: 
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.43
pciBusID: 0000:01:00.0
totalMemory: 3.94GiB freeMemory: 3.45GiB
2017-11-10 17:20:50.857643: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1151] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
2017-11-10 17:21:43.862726: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "DenseToSparseBatchDataset" device_type: "CPU"') for unknown op: DenseToSparseBatchDataset
2017-11-10 17:21:43.862770: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "GroupByWindowDataset" device_type: "CPU"') for unknown op: GroupByWindowDataset
2017-11-10 17:21:43.862783: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "IgnoreErrorsDataset" device_type: "CPU"') for unknown op: IgnoreErrorsDataset
2017-11-10 17:21:43.862803: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "DatasetToSingleElement" device_type: "CPU"') for unknown op: DatasetToSingleElement
2017-11-10 17:21:43.862817: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "SerializeIterator" device_type: "CPU"') for unknown op: SerializeIterator
2017-11-10 17:21:43.862836: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "DeserializeIterator" device_type: "CPU"') for unknown op: DeserializeIterator
2017-11-10 17:21:43.862845: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "MapAndBatchDataset" device_type: "CPU"') for unknown op: MapAndBatchDataset
2017-11-10 17:21:43.862867: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "ParallelInterleaveDataset" device_type: "CPU"') for unknown op: ParallelInterleaveDataset
2017-11-10 17:21:43.862891: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "ScanDataset" device_type: "CPU"') for unknown op: ScanDataset
2017-11-10 17:21:43.862910: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "SqlDataset" device_type: "CPU"') for unknown op: SqlDataset
2017-11-10 17:21:45.342326: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1151] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
2017-11-10 17:21:45.621793: W tensorflow/core/grappler/utils.cc:48] Node ConstantFolding/training/Adam/gradients/batch_normalization_1/batchnorm/add_grad/BroadcastGradientArgs-0 is not in the graph.
2017-11-10 17:21:45.621852: W tensorflow/core/grappler/utils.cc:48] Node ConstantFolding/training/Adam/gradients/batch_normalization_1/batchnorm/add_grad/BroadcastGradientArgs-1 is not in the graph.
2017-11-10 17:21:45.622311: W tensorflow/core/grappler/utils.cc:48] Node ConstantFolding/training/Adam/gradients/batch_normalization_1/cond/batchnorm/sub_grad/BroadcastGradientArgs-0 is not in the graph.
2017-11-10 17:21:45.622332: W tensorflow/core/grappler/utils.cc:48] Node ConstantFolding/training/Adam/gradients/batch_normalization_1/cond/batchnorm/sub_grad/BroadcastGradientArgs-1 is not in the graph.
2017-11-10 17:21:45.622394: W tensorflow/core/grappler/utils.cc:48] Node ConstantFolding/training/Adam/gradients/batch_normalization_1/batchnorm/sub_grad/BroadcastGradientArgs-0 is not in the graph.
2017-11-10 17:21:45.622411: W tensorflow/core/grappler/utils.cc:48] Node ConstantFolding/training/Adam/gradients/batch_normalization_1/batchnorm/sub_grad/BroadcastGradientArgs-1 is not in the graph.
2017-11-10 17:21:45.622470: W tensorflow/core/grappler/utils.cc:48] Node ConstantFolding/training/Adam/gradients/batch_normalization_2/batchnorm/add_grad/BroadcastGradientArgs-0 is not in the graph.

所有包含 device_type: "CPU" 的行是什么意思?

有谁知道这是否正常,或者这是否可能表明某个地方缺少依赖项?

以下包含警告消息的行是 recent change 不小心添加的:

2017-11-10 17:21:43.862726: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "DenseToSparseBatchDataset" device_type: "CPU"') for unknown op: DenseToSparseBatchDataset
2017-11-10 17:21:43.862770: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "GroupByWindowDataset" device_type: "CPU"') for unknown op: GroupByWindowDataset
2017-11-10 17:21:43.862783: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "IgnoreErrorsDataset" device_type: "CPU"') for unknown op: IgnoreErrorsDataset
2017-11-10 17:21:43.862803: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "DatasetToSingleElement" device_type: "CPU"') for unknown op: DatasetToSingleElement
2017-11-10 17:21:43.862817: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "SerializeIterator" device_type: "CPU"') for unknown op: SerializeIterator
2017-11-10 17:21:43.862836: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "DeserializeIterator" device_type: "CPU"') for unknown op: DeserializeIterator
2017-11-10 17:21:43.862845: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "MapAndBatchDataset" device_type: "CPU"') for unknown op: MapAndBatchDataset
2017-11-10 17:21:43.862867: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "ParallelInterleaveDataset" device_type: "CPU"') for unknown op: ParallelInterleaveDataset
2017-11-10 17:21:43.862891: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "ScanDataset" device_type: "CPU"') for unknown op: ScanDataset
2017-11-10 17:21:43.862910: E tensorflow/core/framework/op_kernel.cc:1142] OpKernel ('op: "SqlDataset" device_type: "CPU"') for unknown op: SqlDataset

此更改已 reverted,不应再打印警告消息。