Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/320.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

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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.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
Python 从源代码生成的Tensorflow,不能包含contrib_Python_Tensorflow_Protocol Buffers_Bazel_Protobuf C - Fatal编程技术网

Python 从源代码生成的Tensorflow,不能包含contrib

Python 从源代码生成的Tensorflow,不能包含contrib,python,tensorflow,protocol-buffers,bazel,protobuf-c,Python,Tensorflow,Protocol Buffers,Bazel,Protobuf C,我从源代码构建TF,在python中包含contrib没有问题。当我尝试访问此模块时,出现以下错误: error: _single_image_random_dot_stereograms.so debug map object file '/private/var/tmp/_bazel_mattmurphy/7ec540cd2482edb7e06749c20652a791/execroot/org_tensorflow/bazel-out/darwin-dbg/bin/tensorflow/c

我从源代码构建TF,在python中包含contrib没有问题。当我尝试访问此模块时,出现以下错误:

error: _single_image_random_dot_stereograms.so debug map object file '/private/var/tmp/_bazel_mattmurphy/7ec540cd2482edb7e06749c20652a791/execroot/org_tensorflow/bazel-out/darwin-dbg/bin/tensorflow/contrib/image/_objs/python/ops/_single_image_random_dot_stereograms.so/tensorflow/contrib/image/kernels/single_image_random_dot_stereograms_ops.o' has changed (actual time is 2018-04-23 12:26:04.000000000, debug map time is 2018-04-21 20:47:03.000000000) since this executable was linked, file will be ignored
error: _single_image_random_dot_stereograms.so debug map object file '/private/var/tmp/_bazel_mattmurphy/7ec540cd2482edb7e06749c20652a791/execroot/org_tensorflow/bazel-out/darwin-dbg/bin/tensorflow/contrib/image/_objs/python/ops/_single_image_random_dot_stereograms.so/tensorflow/contrib/image/ops/single_image_random_dot_stereograms_ops.o' has changed (actual time is 2018-04-23 12:26:05.000000000, debug map time is 2018-04-21 20:47:02.000000000) since this executable was linked, file will be ignored
Process 58138 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x48)
    frame #0: 0x0000000131682290 _single_image_random_dot_stereograms.so`google::protobuf::internal::Mutex::Lock(this=0x0000000000000048) at common.cc:376
   373  }
   374
   375  void Mutex::Lock() {
-> 376    int result = pthread_mutex_lock(&mInternal->mutex);
   377    if (result != 0) {
   378      GOOGLE_LOG(FATAL) << "pthread_mutex_lock: " << strerror(result);
   379    }
Target 0: (python) stopped.
错误:_single_image_random_dot_stereograms.so调试贴图对象文件“/private/var/tmp/”bazel\u mattmurphy/7ec540cd2482edb7e06749c20652a791/execroot/org\u tensorflow/bazel out/darwin dbg/bin/tensorflow/contrib/image/”u objs/python/ops/”u single\u image\u randot\u sterograms.so/tensorflow/contrib/image/kernels/singles/single\u image\u randot\u randot\u sterograms\u ops.o”已更改(实际时间为2018-04-23 12:26:04.000000000,调试映射时间为2018-04-21 20:47:03.000000000)由于链接了此可执行文件,文件将被忽略
错误:“\u single\u image\u random\u stereograms.so调试映射对象文件'/private/var/tmp/\u bazel\u mattmurphy/7ec540cd2482edb7e06749c20652a791/execroot/org\u tensorflow/bazel out/darwin dbg/bin/tensorflow/contrib/image/\u objs/python/ops/\u single\u image\u randot\u dot\u tereograms\u stereograms.so/tensorflow/contrib/image/contrib/ops/o”随机点立体图有变化ged(实际时间为2018-04-23 12:26:05.000000000,调试映射时间为2018-04-21 20:47:02.000000000)由于链接了此可执行文件,文件将被忽略
进程58138已停止
*线程#1,队列='com.apple.main thread',停止原因=EXC#U BAD#U访问(代码=1,地址=0x48)
帧#0:0x0000000131682290(单个)图像(随机)点(点)立体图。因此`google::protobuf::internal::Mutex::Lock(此值=0x0000000000000048)位于公共位置。cc:376
373  }
374
375无效互斥体::锁(){
->376 int result=pthread\u mutex\u lock(&mInternal->mutex);
377如果(结果!=0){

378 GOOGLE_LOG(致命)在使用Xcode 9.3在MacOS 10.13.4上编译时,我发现了同样的问题

问题是,
protobuf
静态链接到
libtensorflow\u framework.so
,但也链接到
\u single\u image\u random\u dot\u stereograms.so
libforestprotos.so
,它们在导入
contrib
时被加载

这里有一个相关的例子

该期中的一条评论说,在使用Xcode 8.3或更高版本编译时会出现问题,因此我假设官方的tensorflow二进制文件可以工作,因为它是使用旧版本构建的

作为解决方法,我已经在本地删除了
/tensorflow/tensorflow/contrib/image/BUILD
/tensorflow/tensorflow/tensorflow/tensorflow/contrib/contrib/tensorflow/BUILD
中出现的两个“
@protobuf_archive//:protobuf

这似乎并没有破坏我在python中进行本地实验的用例