我安装了 TensorFlow_gpu_1_15_0 版本,它工作正常。我使用以下命令进行测试:
>>> import tensorflow as tf
>>> tf.test.is_built_with_cuda()
True
>>> tf.test.is_gpu_available(cuda_only=False, min_cuda_compute_capability=None)
True
>>>
但是当我尝试用 c++ 编译一个预制文件时,我得到了一系列错误,例如:
[build] D:/project/.../obj_loader/obj_loader.cpp:22: undefined reference to `tensorflow::shape_inference::InferenceContext::MakeShape(std::initializer_list<tensorflow::shape_inference::DimensionOrConstant>)'
[build] D:/project/.../obj_loader/obj_loader.cpp:122: undefined reference to `__imp__ZN10tensorflow10DEVICE_CPUE'
[build] D:/project/.../obj_loader/obj_loader.cpp:122: undefined reference to `tensorflow::KernelDefBuilder::Device(char const*)'
[build] C:/Users/User/AppData/Roaming/Python/Python37/site-packages/tensorflow_core/include/tensorflow/core/lib/core/refcount.h:90: undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
和其他错误。
任何帮助或参考都会有所帮助。谢谢