如何修复 OSX 上的 tensorflow protobuf 编译错误?

2023-12-11

在查看存储库后,我正在尝试编译 TensorFlow。 我已经陷入了 google protobuf 错误的地步:

INFO: From Compiling tensorflow/core/kernels/histogram_op_gpu.cu.cc:
./tensorflow/core/lib/core/status.h(32): warning: attribute "warn_unused_result" does not apply here

external/protobuf_archive/src/google/protobuf/arena.h(719): error: more than one instance of overloaded function "google::protobuf::Arena::CreateMessageInternal" matches the argument list:
            function template "T *google::protobuf::Arena::CreateMessageInternal<T>(google::protobuf::Arena *)"
            function template "T *google::protobuf::Arena::CreateMessageInternal<T,Args...>(Args &&...)"
            argument types are: (google::protobuf::Arena *)
          detected during:
            instantiation of "Msg *google::protobuf::Arena::CreateMaybeMessage<Msg>(google::protobuf::Arena *, google::protobuf::internal::true_type) [with Msg=tensorflow::TensorShapeProto_Dim]" 
(729): here
            instantiation of "T *google::protobuf::Arena::CreateMaybeMessage<T>(google::protobuf::Arena *) [with T=tensorflow::TensorShapeProto_Dim]" 
external/protobuf_archive/src/google/protobuf/repeated_field.h(648): here
            instantiation of "GenericType *google::protobuf::internal::GenericTypeHandler<GenericType>::New(google::protobuf::Arena *) [with GenericType=tensorflow::TensorShapeProto_Dim]" 
external/protobuf_archive/src/google/protobuf/repeated_field.h(675): here
            instantiation of "GenericType *google::protobuf::internal::GenericTypeHandler<GenericType>::NewFromPrototype(const GenericType *, google::protobuf::Arena *) [with GenericType=tensorflow::TensorShapeProto_Dim]" 
external/protobuf_archive/src/google/protobuf/repeated_field.h(1554): here
            instantiation of "TypeHandler::Type *google::protobuf::internal::RepeatedPtrFieldBase::Add<TypeHandler>(TypeHandler::Type *) [with TypeHandler=google::protobuf::RepeatedPtrField<tensorflow::TensorShapeProto_Dim>::TypeHandler]" 
external/protobuf_archive/src/google/protobuf/repeated_field.h(2001): here
            instantiation of "Element *google::protobuf::RepeatedPtrField<Element>::Add() [with Element=tensorflow::TensorShapeProto_Dim]" 
bazel-out/local_darwin-opt/genfiles/tensorflow/core/framework/tensor_shape.pb.h(471): here

....

有人遇到过这个问题吗?关于如何解决这个问题有什么想法吗?

(我在 OSX 10.11.5 的虚拟环境中使用 Python 2.7)


幸运的是,其他人不仅已经遇到了同样的问题,而且还找到了解决方案并分享了它。感谢丹尼尔·特雷比恩对 protobuf 的评论 and eigen我可以在 OSX 上编译具有 GPU 支持的张量流:

>>> import tensorflow as tf
>>> tf.__version__
'1.6.0-rc0'
>>> sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
2018-02-19 22:22:12.194516: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:859] OS X does not support NUMA - returning NUMA node zero
2018-02-19 22:22:12.195011: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1331] Found device 0 with properties: 
name: GeForce GT 750M major: 3 minor: 0 memoryClockRate(GHz): 0.9255
pciBusID: 0000:01:00.0
totalMemory: 2.00GiB freeMemory: 12.58MiB
2018-02-19 22:22:12.195038: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1410] Adding visible gpu devices: 0
2018-02-19 22:22:14.563665: I tensorflow/core/common_runtime/gpu/gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-02-19 22:22:14.563700: I tensorflow/core/common_runtime/gpu/gpu_device.cc:917]      0 
2018-02-19 22:22:14.563707: I tensorflow/core/common_runtime/gpu/gpu_device.cc:930] 0:   N 
2018-02-19 22:22:14.563798: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1021] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 65 MB memory) -> physical GPU (device: 0, name: GeForce GT 750M, pci bus id: 0000:01:00.0, compute capability: 3.0)
Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GT 750M, pci bus id: 0000:01:00.0, compute capability: 3.0
2018-02-19 22:22:14.697626: I tensorflow/core/common_runtime/direct_session.cc:297] Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GT 750M, pci bus id: 0000:01:00.0, compute capability: 3.0

作为参考,以下是评论中建议的补丁:

--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -353,11 +353,11 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
   tf_http_archive(
       name = "protobuf_archive",
       urls = [
-          "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
-          "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
+          "https://mirror.bazel.build/github.com/dtrebbien/protobuf/archive/50f552646ba1de79e07562b41f3999fe036b4fd0.tar.gz",
+          "https://github.com/dtrebbien/protobuf/archive/50f552646ba1de79e07562b41f3999fe036b4fd0.tar.gz",
       ],
-      sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3",
-      strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a",
+      sha256 = "eb16b33431b91fe8cee479575cee8de202f3626aaf00d9bf1783c6e62b4ffbc7",
+      strip_prefix = "protobuf-50f552646ba1de79e07562b41f3999fe036b4fd0",
   )

--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -120,11 +120,11 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
   tf_http_archive(
       name = "eigen_archive",
       urls = [
-          "https://mirror.bazel.build/bitbucket.org/eigen/eigen/get/2355b229ea4c.tar.gz",
-          "https://bitbucket.org/eigen/eigen/get/2355b229ea4c.tar.gz",
+          "https://mirror.bazel.build/bitbucket.org/dtrebbien/eigen/get/374842a18727.tar.gz",
+          "https://bitbucket.org/dtrebbien/eigen/get/374842a18727.tar.gz",
       ],
-      sha256 = "0cadb31a35b514bf2dfd6b5d38205da94ef326ec6908fc3fd7c269948467214f",
-      strip_prefix = "eigen-eigen-2355b229ea4c",
+      sha256 = "fa26e9b9ff3a2692b092d154685ec88d6cb84d4e1e895006541aff8603f15c16",
+      strip_prefix = "dtrebbien-eigen-374842a18727",
       build_file = str(Label("//third_party:eigen.BUILD")),
   )
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何修复 OSX 上的 tensorflow protobuf 编译错误? 的相关文章

随机推荐

  • php simplexml_load_file 带有破折号 ( - )

    嗨 我正在努力从 php 中的 xml 文件获取数据 xml 文件在这里 http musicbrainz org ws 2 artist 8bfac288 ccc5 448d 9573 c33ea2aa5c30 inc release g
  • 在 ObjectAnimationUsingKeyFrames 中使用 TemplateBinding

    我尝试设置鼠标悬停在控件上时的背景颜色 我尝试通过视觉状态管理器来做到这一点 我能够运行以下代码
  • form.valid() 不应显示验证文本?

    With Jquery validate required fields are showing popup validation on fileds like below pic 我喜欢这个并且工作得很好 但我检查 form valid
  • 从服务器导入 LESS

    在我的 ASP NET MVC 应用程序中 我有一个返回 LESS 变量的操作 我想将这些变量导入到我的主 LESS 文件中 由于 DotLess 只会导入扩展名为 less 或 css 的文件 因此推荐的方法是什么 我发现最简单的解决方案
  • 如何使用泛型实现类型安全?

    我有课 public class ReportItem
  • pyqt5中的连接功能不起作用

    我最近从pyside to pyqt5有一个问题 我在网上查了一下 显然 这已经发生在使用过的人身上pyqt4并搬到pyqt5 然而 它并没有真正帮助 我尝试添加pyqtSignal after Qobject但它仍然不起作用 请帮忙 这些
  • 创建性能计数器时 Azure 模拟器出错

    我正在尝试测量 Azure 项目上的处理器负载 在运行模拟器时 我在模拟器控制台中收到如下错误 MonAgentHost Error MA EVENT 2012 10 10T12 15 06 982Z MonAgentHost Error
  • 阿拉伯语的布局方向不是根据区域设置确定的(Mac 和 Linux)

    有没有人设法从用户 的语言设置中推断出正确的布局方向 从左到右和从右到左 我在将应用程序本地化为阿拉伯语 沙特阿拉伯 语言环境时遇到问题 检测当前区域设置以及加载和安装适当的 QTranslators 都可以正常工作 文本在 Linux 上
  • 这是php中的快速进程strpos()/stripos()或preg_match()

    我只是想知道 php 中的 strpos stripos 或 preg match 函数中哪一个更快 I found 这个博客针对您的问题运行了一些睾丸 结果是 strpos 比 preg match 快 3 16 倍 stripos 比
  • 按顺序收集值,每个值包含一个地图

    当迭代代码中由主题函数返回的返回映射时 键未按顺序出现 如何使键按顺序排列 对地图进行排序 以便键按顺序且值相对应 Here is the code The Go 博客 Go 地图的实际应用有一个很好的解释 当使用范围循环迭代映射时 迭代顺
  • Postgresql 中子字符串的区别

    最近几天我在查看 PostgreSQL 手册 我注意到substring 在那里解释为substring string FROM int FOR int 我通常只使用substring string int int 因为我是从 MySQL
  • python selenium 鼠标滚轮点击

    我有一个问题 是否可以在 python selenium 中模拟鼠标滚轮单击 当您单击链接时 浏览器中会打开一个新选项卡 或类似的东西 我使用的网站是基于 JavaScript 的 所以我看不到物理链接 您需要执行 JavaScript 代
  • Electron-forge 和 osx 签名应用程序导致“二进制文件签名不正确”。

    我使用以下 功能 开发了一个电子应用程序 Base 电子锻造 开始 制作和发布 电子open url功能 方案 xx note node keytar 获取和设置密码 无框应用程序 透明窗户 自动更新 with Nucleus 正在开发 W
  • 用于抓取光标(拖放)的 CSS

    我有一个 JavaScript Web 应用程序 用户需要抓住背景来移动整个屏幕 所以我希望当它们悬停在背景上时光标发生变化 这 moz grab and moz grabbingCSS 光标非常适合此目的 当然 它们仅适用于 Firefo
  • 如何忽略where子句中的条件

    从表 1 中选择字段 1 其中字段 1 gt 4006 AND 字段 1 4006 且字段 2 假 排序依据字段1 限制1 我想要第二个条件 AND field1 lt 如果内部选择没有返回记录 则被忽略 与此相关topic 像这样的东西
  • node.js 中 module.exports= 函数的含义

    我正在使用 node js 迈出第一步 显然我尝试做的第一件事就是从模块导出一些数据 所以我尝试了这个简单的情况 虚拟 js var user rally module exports user user 并比从不同的文件中需要它 如下所示
  • Inno Setup - FileCopy 在路径名中使用通配符

    我正在尝试将所有数据库文件从以前的安装复制到具有新路径名的新安装 问题是安装程序不知道数据库文件的名称 所以我尝试使用通配符 我尝试使用 TFileStream Create 但这是搜索单个文件 例如 mdb 并且我不断收到错误消息 指出找
  • 有没有一种方法可以在没有运行时开销的情况下构建具有循环链接的结构?

    我正在尝试在 Rust 中实现循环链 接数据结构 我的Nodes 定义为 derive Debug enum Node lt a gt Link a Node lt a gt Leaf 我正在尝试构建一个像这样的最小结构 额外的括号以获得更
  • 使用foreach将gridview数据插入sql数据库

    我有一个客户端 gridview 数据 我想将 gridview 数据插入到 sql 数据库中 起初我将数据从excel导入到gridview 现在我想将其插入到sql数据库中 我使用 foreach 循环来一条一条地插入记录 但 fore
  • 如何修复 OSX 上的 tensorflow protobuf 编译错误?

    在查看存储库后 我正在尝试编译 TensorFlow 我已经陷入了 google protobuf 错误的地步 INFO From Compiling tensorflow core kernels histogram op gpu cu