cppFlow and tensorflow 2
I used cppFlow for TF2 and got following error. Does it support tensorflow 2?
#include "../../include/Model.h"
#include "../../include/Tensor.h"
#include <opencv2/opencv.hpp>
#include
int main() {
// Create model
Model m("../model.pb");
}
Error LNK2019 unresolved external symbol "public: __cdecl Model::Model(class std::basic_string<char,struct std::char_traits
-
Yes, tf2 is supported
-
Your issue seems to be a linking problem with cppflow.
Yes, as @ljn917 commented, it looks like a linking problem.
Which TensorFlow C package are you using? and, how are you compiling and linking your code?
@serizba I met the similar linking error when I'm compiling the example project "load_model". I followed the instruction and used cmake to generate the Visual Studio project. When I'm trying to use VS2019 on Windows 10 to build the project I got the following linking error:
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_load4,函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::_Insert_string<char,struct std::char_traits<char>,unsigned __int64>(class std::basic_ostream<char,struct std::char_traits<char> > &,char const * const,unsigned __int64)" (??$_Insert_string@DU?$char_traits@D@std@@_K@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@QEBD_K@Z) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_load8,函数 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::_Insert_string<char,struct std::char_traits<char>,unsigned __int64>(class std::basic_ostream<char,struct std::char_traits<char> > &,char const * const,unsigned __int64)" (??$_Insert_string@DU?$char_traits@D@std@@_K@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@QEBD_K@Z) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_memcpy,函数 "public: __cdecl std::tuple<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class cppflow::tensor>::tuple<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class cppflow::tensor><char const (&)[24],class cppflow::tensor const &,0>(char const (&)[24],class cppflow::tensor const &)" (??$?0AEAY0BI@$$CBDAEBVtensor@cppflow@@$0A@@?$tuple@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Vtensor@cppflow@@@std@@QEAA@AEAY0BI@$$CBDAEBVtensor@cppflow@@@Z) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_memset,函数 "public: __cdecl std::vector<float,class std::allocator<float> >::vector<float,class std::allocator<float> ><float *,0>(float *,float *,class std::allocator<float> const &)" (??$?0PEAM$0A@@?$vector@MV?$allocator@M@std@@@std@@QEAA@PEAM0AEBV?$allocator@M@1@@Z) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_report_load1,函数 "public: __cdecl std::_Temporary_owner_del<struct TFE_TensorHandle *,void (__cdecl*)(struct TFE_TensorHandle *)>::~_Temporary_owner_del<struct TFE_TensorHandle *,void (__cdecl*)(struct TFE_TensorHandle *)>(void)" (??1?$_Temporary_owner_del@PEAUTFE_TensorHandle@@P6AXPEAU1@@Z@std@@QEAA@XZ) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_report_load4,函数 main 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_report_load8,函数 "public: __cdecl std::_Compressed_pair<struct std::default_delete<struct TF_Tensor * [0]>,struct TF_Tensor * *,1>::_Compressed_pair<struct std::default_delete<struct TF_Tensor * [0]>,struct TF_Tensor * *,1><struct TF_Tensor * * &>(struct std::_Zero_then_variadic_args_t,struct TF_Tensor * * &)" (??$?0AEAPEAPEAUTF_Tensor@@@?$_Compressed_pair@U?$default_delete@$$BY0A@PEAUTF_Tensor@@@std@@PEAPEAUTF_Tensor@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAPEAUTF_Tensor@@@Z) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_report_store1,函数 "public: __cdecl std::_Temporary_owner_del<struct TFE_TensorHandle *,void (__cdecl*)(struct TFE_TensorHandle *)>::_Temporary_owner_del<struct TFE_TensorHandle *,void (__cdecl*)(struct TFE_TensorHandle *)>(struct TFE_TensorHandle * const,void (__cdecl*&)(struct TFE_TensorHandle *))" (??0?$_Temporary_owner_del@PEAUTFE_TensorHandle@@P6AXPEAU1@@Z@std@@QEAA@QEAUTFE_TensorHandle@@AEAP6AXPEAU2@@Z@Z) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_report_store4,函数 "public: __cdecl std::_Tuple_val<int>::_Tuple_val<int><int>(int &&)" (??$?0H@?$_Tuple_val@H@std@@QEAA@$$QEAH@Z) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_report_store8,函数 "public: __cdecl std::_Compressed_pair<struct std::default_delete<struct TF_Tensor * [0]>,struct TF_Tensor * *,1>::_Compressed_pair<struct std::default_delete<struct TF_Tensor * [0]>,struct TF_Tensor * *,1><struct TF_Tensor * * &>(struct std::_Zero_then_variadic_args_t,struct TF_Tensor * * &)" (??$?0AEAPEAPEAUTF_Tensor@@@?$_Compressed_pair@U?$default_delete@$$BY0A@PEAUTF_Tensor@@@std@@PEAPEAUTF_Tensor@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAPEAUTF_Tensor@@@Z) 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_set_shadow_00,函数 main 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_set_shadow_f8,函数 main 中引用了该符号
2>main.obj : error LNK2019: 无法解析的外部符号 __asan_shadow_memory_dynamic_address,函数 main 中引用了该符号
2>C:\Users\quint\cppflow\examples\load_model\build\Debug\example.exe : fatal error LNK1120: 13 个无法解析的外部命令
I've already add the path of tensorflow.dll and tensorflow.lib to the system PATH and the project's settings in VS 2019 as well:

Am I missing something? I really need some help.
Hi, @Bennett-Yang , I got a similar problem as yours, but I use the CPU version. I just wanna know have resolved your problem?
Hi, @Bennett-Yang , I got a similar problem as yours, but I use the CPU version. I just wanna know have resolved your problem?
Sorry, I'm no longer working on the project I mentioned above. I still have no solution to this problem.
Cppflow2 supports TF 2