我正在尝试使用此Tensorflow Doc在Google Colab的 Tensorflow 中添加自定义操作。但是,在构建时出现此错误。
2021-04-05 04:24:26.500483: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
2021-04-05 04:24:29.436586: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
xor_op.cc:2:10: fatal error: tensorflow/core/framework/common_shape_fns.h: No such file or directory
#include "tensorflow/core/framework/common_shape_fns.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
构建命令是,
$ TF_LFLAGS=($(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))'))
$ TF_CFLAGS=($(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))'))
$
$ g++ -std=c++14 -shared xor_op.cc -o xor_op.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2
知道在这种情况下有什么问题吗?