error: ‘_GraphFactory’ was not declared in this scope

error: ‘_GraphFactory’ was not declared in this scope


When I build the cnn_alexnet sample, an error occur:

cnn_alexnet/cnn_alexnet.cpp:171:107: error: ‘_GraphFactory’ was not declared in this scope
 ory(context, graph, &vxObjectsContainer, includeNodesList, filteredNodeCount));

However, other samples, e.g auto_contrast, work fine. Any idea how to solve it?


4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I think I have already fixed it by myself. What I have done:

1) The cnn_alexnet.cpp use the wrong api (maybe it is old version code). I simply change

        CHECK_VX_STATUS(_GraphFactory(context, graph, &vxObjectsContainer, includeNodesList, filteredNodeCount));


        CHECK_VX_STATUS(GraphFactory(context, graph, &vxObjectsContainer, includeNodesList, filteredNodeCount,1));

2) However, the CMakeLists.txt file still have some problem. Another error occur:


        load_weights.c:2:35: fatal error: load_tensor_from_file.h: No such file or directory


So the other modification is add 'load_tensor_from_file.*' to files_to_copy and GENERATED_SOURCES.

Then compiling is OK.

But when I execute the bin, the default path to find the weights' file is the current folder. So after setting the right path, the expected demo is displayed.

BTW, this demo is quite cool for selecting the ROI for classification, nice job.^_^




Hi Jim,

Happy to hear you managed to solve the issue and are happy with the demo, 

I will check regarding the difrances in API.




Its looks like in the older Sdk it is _GraphFactory() and  in the newer IntelSdk R2 release it is modified into GraphFactory().

(May be you have generated code using newer Sdk, but didnt change your main() to call these newer renamed functions (?))

Leave a Comment

Please sign in to add a comment. Not a member? Join today