我正在使用tensorflow-v1.12.0构建我的tf服务服务。我已经尝试过各种可用于我的CPU的copt。但是结果没有达到我的预期。下图显示了我项目中每个警察的表演。
我想知道为什么警察没有任何积极的作用。参考:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
最后自己找到答案。这是因为我没有在编译中启用mkl。使用CPU指令集优化来编译TF的正确方法是添加“ --config = mkl -c opt --copt = mavx2”
它减少了我项目中预计时间成本的20%。