这里要为仅支持 CPU 的 TensorFlow 构建一个 pip 软件包,需要调用以下命令:
$ bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt --verbose_failures //tensorflow/tools/pip_package:build_pip_package
大概编译15分钟后,输出错误信息如下:
ERROR: /private/var/tmp/_bazel_mazhiyong/54650f23f4cec88510e7895c92a68913/external/protobuf_archive/BUILD:659:1: C++ compilation of rule '@protobuf_archive//:python/google/protobuf/pyext/_message.so' failed (Exit 1)
external/protobuf_archive/python/google/protobuf/pyext/message.cc:547:11: error: assigning to 'char *' from incompatible type 'const char *'
if (PyString_AsStringAndSize(key, &key_str_data, &key_str_size) != 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:82:22: note: expanded from macro 'PyString_AsStringAndSize'
((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:998:7: error: assigning to 'char *' from incompatible type 'const char *'
if (PyString_AsStringAndSize(name, &field_name, &size) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:82:22: note: expanded from macro 'PyString_AsStringAndSize'
((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:1035:9: error: assigning to 'char *' from incompatible type 'const char *'
if (PyString_AsStringAndSize(value, &enum_label, &size) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:82:22: note: expanded from macro 'PyString_AsStringAndSize'
((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:1532:16: error: assigning to 'char *' from incompatible type 'const char *'
field_name = PyUnicode_AsUTF8AndSize(arg, &size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:2048:7: warning: 'PyObject_AsReadBuffer' is deprecated [-Wdeprecated-declarations]
if (PyObject_AsReadBuffer(arg, &data, &data_length) < 0) {
^
bazel-out/darwin-opt/genfiles/external/local_config_python/python_include/abstract.h:492:39: note: 'PyObject_AsReadBuffer' has been explicitly marked deprecated here
Py_DEPRECATED(3.0);
^
bazel-out/darwin-opt/genfiles/external/local_config_python/python_include/pyport.h:493:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
external/protobuf_archive/python/google/protobuf/pyext/message.cc:2119:7: error: assigning to 'char *' from incompatible type 'const char *'
if (PyString_AsStringAndSize(arg, &name_data, &name_size) < 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:82:22: note: expanded from macro 'PyString_AsStringAndSize'
((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 5 errors generated.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 771.278s, Critical Path: 26.15s
INFO: 2156 processes: 2156 local.
FAILED: Build did NOT complete successfully
这个错误我估计是编译器与代码兼容的问题,查找了半天暂时没找到解决办法,所以就暂时搁置了TensorFlow主分支代码在Python3.7环境下的代码编译,过一段时间再试试。
- TensorFlow Python3.7环境下的源码编译(二)安装配置
源代码树的根目录中包含了一个名为 configure 的 bash 脚本. $ ./configure 接下来,配置系统会给出各种询问,以确认编译时的配置参数. 一.重要参数解释 Please s ...
- TensorFlow Python3.7环境下的源码编译(一)环境准备
参考: https://blog.csdn.net/yhily2008/article/details/79967118 https://tensorflow.google.cn/install/in ...
- TensorFlow Python2.7环境下的源码编译(三)编译
一.源代码编译 这里要为仅支持 CPU 的 TensorFlow 构建一个 pip 软件包,需要调用以下命令: $ bazel build --cxxopt="-D_GLIBCXX_USE_ ...
- TensorFlow Python2.7环境下的源码编译(一)环境准备
参考: https://blog.csdn.net/yhily2008/article/details/79967118 https://tensorflow.google.cn/install/in ...
- TensorFlow Python2.7环境下的源码编译(二)安装配置
源代码树的根目录中包含了一个名为 configure 的 bash 脚本. $ ./configure 接下来,配置系统会给出各种询问,以确认编译时的配置参数. 一.重要参数解释 Do you w ...
- Linux环境下levelDB源码编译与安装
1.下载源码并编译 git clone https://github.com/google/leveldb.git cd leveldb //编译源码的时候需要安装cmake,并且版本需要大于3.9, ...
- 23 使用环境 UsageEnvironment——Live555源码阅读
23 使用环境 UsageEnvironment——Live555源码阅读(三)UsageEnvironment 23 使用环境 UsageEnvironment——Live555源码阅读(三)Usa ...
- 在docker容器中python3.5环境下使用DIGITS训练caffe模型
********* 此处使用的基础镜像为 nvcr.io/nvidia/digits:18.06,镜像大小为6.04GB,可从nvidia官方pull此镜像: 容器配置: CUDA:9.0 CUDNN ...
- 基于Docker的TensorFlow机器学习框架搭建和实例源码解读
概述:基于Docker的TensorFlow机器学习框架搭建和实例源码解读,TensorFlow作为最火热的机器学习框架之一,Docker是的容器,可以很好的结合起来,为机器学习或者科研人员提供便捷的 ...
随机推荐
- 【转】【Flex】FLEX 学习网站分享
[转:http://hi.baidu.com/tanghecaiyu/item/d662fbd7f5fbe02c38f6f764 ] FLEX 学习网站分享 http://blog.minidx.co ...
- Promise & Deferred Objects in JavaScript Pt.2: in Practice
原文:http://blog.mediumequalsmessage.com/promise-deferred-objects-in-javascript-pt2-practical-use Intr ...
- SGU---105 水题
题目链接: https://cn.vjudge.net/problem/SGU-105 题目大意: 定义一个数列 1,12,123,1234,12345......12345678910,123456 ...
- Spring-IOC 在非 web 环境下优雅关闭容器
当我们设计一个程序时,依赖了Spring容器,然而并不需要spring的web环境时(Spring web环境已经提供了优雅关闭),即程序启动只需要启动Spring ApplicationContex ...
- BZOJ2281:[SDOI2011]黑白棋(博弈论,组合数学,DP)
Description 小A和小B又想到了一个新的游戏. 这个游戏是在一个1*n的棋盘上进行的,棋盘上有k个棋子,一半是黑色,一半是白色. 最左边是白色棋子,最右边是黑色棋子,相邻的棋子颜色不同. 小 ...
- 1303. [CQOI2009]中位数【前缀和+乱搞】
Description 给出1~n的一个排列,统计该排列有多少个长度为奇数的连续子序列的中位数是b.中位数是指把所有元素从小到大排列后,位于中间的数. Input 第一行为两个正整数n和b ,第二行为 ...
- python伪装网页访问
# -*- coding:utf8 -*-#import urllib.request#url =' http://www.douban.com/'#webPage=urllib.request.ur ...
- 20145203 盖泽双《Java程序设计》第一周的学习总结
20145203 盖泽双<Java程序设计>第一周学习总结 教材学习内容总结 第一章 1.Java是一门完全面向对象,安全可靠,与平台无关的编程语言. 2.Java现由Java SE.Ja ...
- selenium测试报告(含通过率统计图和失败截图)
前言: 介绍的是含饼状统计图及失败截图的测试报告文件. 原文地址:https://testerhome.com/topics/9984 此版本增加了如下功能 测试报告完全汉化,包括错误日志的中文处理 ...
- ddt 接口示范以及报告生成html案例
1.数据构造获取我就不写了直接以test_data=[ ] 构造一个简单数据建模.实际你从哪里获取根据情况excel也好yaml也罢 2.用例套件处理,报告生成处理 import ddtimport ...