小编NN_*_*_05的帖子

致命错误:google/protobuf/port_def.inc:没有这样的文件或目录#include <google/protobuf/port_def.inc>

我有窗户。我想使用库 tensorflow 创建一个 C++ op。从这个网站https://www.tensorflow.org/guide/extend/op#compile_the_op_using_your_system_compiler_tensorflow_binary_installation我明白我应该做以下:

TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )
g++ -std=c++11 -shared zero_out.cc -o zero_out.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2
Run Code Online (Sandbox Code Playgroud)

我就是这么做的。但我遇到了下一个问题:

In file included from C:\Python\Python37\lib\site-packages\tensorflow\include/tensorflow/core/framework/op_def_builder.h:24,
                 from C:\Python\Python37\lib\site-packages\tensorflow\include/tensorflow/core/framework/op.h:23,
                 from zero_out.cc:4:
C:\Python\Python37\lib\site-packages\tensorflow\include/tensorflow/core/framework/op_def.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
 #include google/protobuf/port_def.inc
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Run Code Online (Sandbox Code Playgroud)

我不明白我该如何解决这个问题。如果你能帮我解决这个问题,我将不胜感激

c++ windows g++ protobuf-c tensorflow

6
推荐指数
1
解决办法
7445
查看次数

在 C++ 上使用 atomic_flag

我是 C++ 并发编程的初学者。我读了 std::atomic_flag ,但我不明白这个 atomic_flag 在哪里有用。也许有人可以解释一下 atomic_flag 对哪些任务有用

c++ concurrency

0
推荐指数
1
解决办法
94
查看次数

标签 统计

c++ ×2

concurrency ×1

g++ ×1

protobuf-c ×1

tensorflow ×1

windows ×1