我尝试在 Ubuntu 上安装适用于 C 的 TensorFlow。我按照 https://www.tensorflow.org/install/install_c 上的所有说明进行操作.
请参阅下面的命令和结果。为什么我会收到编译错误?
cd /home/sarkar/tensorflow
gcc hello_tf.c
输出:
hello_tf.c: In function ‘main’:
hello_tf.c:5:3: error: stray ‘\342’ in program
printf(“Tensor flow C library version %s\n”,TF_Version());
^
hello_tf.c:5:3: error: stray ‘\200’ in program
hello_tf.c:5:3: error: stray ‘\234’ in program
hello_tf.c:5:13: error:‘Tensor’ undeclared (first use in thisfunction)
printf(“Tensor flow C library version %s\n”,TF_Version());
^
hello_tf.c:5:13: note: each undeclared identifier is reported only
once for each function it appears in
hello_tf.c:5:20: error: expected ‘)’ before ‘flow’
printf(“Tensor flow C library version %s\n”,TF_Version());
^
hello_tf.c:5:20: error: stray ‘\’ in program
hello_tf.c:5:20: error: stray ‘\342’ in program
最佳答案
经过一番研究,我发现了这个:GCC stray errors
错误的原因是引号。一个可能的解决办法是更换它们。
关于c - C 中的 TensorFlow : Why do I get a compilation error in hello_tf. c?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44730791/