Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 多线程上的TensorFlow基准测试_Linux_Tensorflow_Benchmarking - Fatal编程技术网

Linux 多线程上的TensorFlow基准测试

Linux 多线程上的TensorFlow基准测试,linux,tensorflow,benchmarking,Linux,Tensorflow,Benchmarking,昨天,我使用TensorFlow的Conda构建运行了一些性能测试,即TFV1.12: conda create -n tf_conda python=3.6.8 tensorflow git clone -b cnn_tf_v1.12_compatible --single-branch https://github.com/tensorflow/benchmarks.git cd benchmarks/scripts/tf_cnn_benchmarks/ conda activate tf_

昨天,我使用TensorFlow的Conda构建运行了一些性能测试,即TFV1.12:

conda create -n tf_conda python=3.6.8 tensorflow
git clone -b cnn_tf_v1.12_compatible --single-branch https://github.com/tensorflow/benchmarks.git
cd benchmarks/scripts/tf_cnn_benchmarks/
conda activate tf_conda
python tf_cnn_benchmarks.py --device=cpu --model=resnet50 --data_format=NHWC --num_batches=10 --num_warmup_batches=1
今天,当我使用Conda安装TensorFlow时,我的最终版本是v1.13:

conda create -n tf_conda python=3.6.8 tensorflow
git clone -b cnn_tf_v1.13_compatible --single-branch https://github.com/tensorflow/benchmarks.git
cd benchmarks/scripts/tf_cnn_benchmarks/
conda activate tf_conda
python tf_cnn_benchmarks.py --device=cpu --model=resnet50 --data_format=NHWC --num_batches=10 --num_warmup_batches=1
然而,基准测试失败得很惨:

2019-04-05 08:41:04.146441: 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
2019-04-05 08:41:04.164798: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2599995000 Hz
2019-04-05 08:41:04.165499: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x563d6af00290 executing computations on platform Host. Devices:
2019-04-05 08:41:04.165542: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>
OMP: Info #212: KMP_AFFINITY: decoding x2APIC ids.
OMP: Info #213: KMP_AFFINITY: cpuid leaf 11 not supported - decoding legacy APIC ids.
OMP: Info #149: KMP_AFFINITY: Affinity capable, using global cpuid info
OMP: Info #154: KMP_AFFINITY: Initial OS proc set respected: 0-3
OMP: Info #156: KMP_AFFINITY: 4 available OS procs
OMP: Info #157: KMP_AFFINITY: Uniform topology
OMP: Info #159: KMP_AFFINITY: 4 packages x 1 cores/pkg x 1 threads/core (4 total cores)
OMP: Info #214: KMP_AFFINITY: OS proc to physical thread map:
OMP: Info #171: KMP_AFFINITY: OS proc 0 maps to package 0
OMP: Info #171: KMP_AFFINITY: OS proc 1 maps to package 1
OMP: Info #171: KMP_AFFINITY: OS proc 2 maps to package 2
OMP: Info #171: KMP_AFFINITY: OS proc 3 maps to package 3
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1539 thread 0 bound to OS proc set 0
2019-04-05 08:41:04.166391: I tensorflow/core/common_runtime/process_util.cc:71] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
W0405 08:41:04.172703 140193590863680 deprecation.py:323] From /home/nsapay/anaconda3/envs/tf_conda/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
...
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1557 thread 1 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1585 thread 3 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1586 thread 4 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1584 thread 2 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1556 thread 5 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1588 thread 7 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1587 thread 6 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1589 thread 8 bound to OS proc set 0
Killed. 
2019-04-05 08:41:04.146441:I tensorflow/core/platform/cpu\u feature\u guard.cc:141]您的cpu支持未编译此tensorflow二进制文件以使用的指令:SSE4.1 SSE4.2 AVX
2019-04-05 08:41:04.164798:I tensorflow/core/platform/profile_-utils/cpu_-utils.cc:94]cpu频率:2599995000 Hz
2019-04-05 08:41: 4.165499:I TysFult/Cyp/XLA/Service / Service .CC:150)XLA服务0x563D6AF6290在平台主机上执行计算。设备:
2019-04-05 08:41:04.165542:I tensorflow/compiler/xla/service/service.cc:158]流执行器设备(0):,
OMP:Info#212:KMP#u关联:解码x2APIC ID。
OMP:Info#213:KMP#U关联:cpuid叶11不受支持-解码旧的APIC ID。
OMP:Info#149:KMP#U关联:支持关联,使用全局cpuid信息
OMP:Info#154:KMP#U关联:初始操作系统进程集:0-3
OMP:Info#156:KMP#U关联:4个可用操作系统进程
OMP:Info#157:KMP#U关联:统一拓扑
OMP:Info#159:KMP#U亲缘关系:4个包x 1个内核/包x 1个线程/内核(共4个内核)
OMP:Info#214:KMP#U关联:操作系统进程到物理线程映射:
OMP:Info#171:KMP#U关联:OS proc 0映射到包0
OMP:Info#171:KMP#U关联:OS proc 1映射到包1
OMP:Info#171:KMP#U关联性:OS proc 2映射到包2
OMP:Info#171:KMP#U关联:OS proc 3映射到包3
OMP:Info#250:KMP#U关联:pid 1539 tid 1539线程0绑定到操作系统进程集0
2019-04-05 08:41:04.166391:I tensorflow/core/common_runtime/process_util.cc:71]使用默认的操作间设置创建新线程池:2。使用inter_op_parallelism_线程进行优化,以获得最佳性能。
W0405 08:41:04.172703 140193590863680不推荐使用。py:323]From/home/nsapay/anaconda3/envs/tf_conda/lib/python3.6/site packages/tensorflow/python/framework/op_def_library。py:263:colocate_with(来自tensorflow.python.framework.ops)已不推荐使用,将在未来版本中删除。
更新说明:
由placer自动处理Colocations。
...
OMP:Info#250:KMP#U关联:pid 1539 tid 1557线程1绑定到操作系统进程集1
OMP:Info#250:KMP#U关联:pid 1539 tid 1585线程3绑定到操作系统进程集3
OMP:Info#250:KMP#U关联:pid 1539 tid 1586线程4绑定到操作系统进程集0
OMP:Info#250:KMP#U关联:pid 1539 tid 1584线程2绑定到操作系统进程集2
OMP:Info#250:KMP#U关联:pid 1539 tid 1556线程5绑定到操作系统进程集1
OMP:Info#250:KMP#U关联:pid 1539 tid 1588线程7绑定到操作系统进程集3
OMP:Info#250:KMP#U关联:pid 1539 tid 1587线程6绑定到操作系统进程集2
OMP:Info#250:KMP#U关联:pid 1539 tid 1589线程8绑定到操作系统进程集0
被杀死的。

我完全困惑。。。从昨天到今天,我没有更新系统。我正在使用4个(virutal)内核(Intel Xeon E3)和常规的CentOS 7发行版。

事实上,我的内存不足。内存监控来自另一台虚拟机(同时使用多台机器带来的不便)。

检查内核日志,查看内存不足杀手是否杀死了它。(
dmesg | less
并搜索OOM)实际上,我有一个内存不足错误。这是出乎意料的,因为有7.3/7.5 GB可用。此外,我能够在具有类似硬件配置的(物理)Windows机器上执行基准测试。这可能与虚拟化有关吗?那就这样吧。你的TensorFlow占用了太多内存,它触发了你机器上的OOM杀手。理论上,您可以添加更多的交换空间,但性能通常是不可接受的。(这确实让内核可以先交换除“热”页面之外的其他内容,但除了使用内存的tensorflow之外,可能没有其他东西了。)谢谢,我正试图找出什么是开发人员的最小tensorflow机器。我已经得到了答案。