Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么生成tenserflow2ncnn可执行文件 #107

Closed
elva7073 opened this issue Aug 24, 2017 · 2 comments
Closed

怎么生成tenserflow2ncnn可执行文件 #107

elva7073 opened this issue Aug 24, 2017 · 2 comments

Comments

@elva7073
Copy link

Hi 我尝试在cmakelist中添加tensorflow后,发现protoc版本不匹配,更新了protobuf的最新release版本,在生成.pb文件的时候又提示version不对,想请教一下如何生成tenserflow2ncnn的可执行文件呀,我需要用protoc的什么版本? 刚接触这一块,问题比较小白~

@darkstarslyp
Copy link

cmake_minimum_required(VERSION 3.6)
project(tensorflow2ncnn)

find_package(Protobuf REQUIRED)

include_directories(${PROTOBUF_INCLUDE_DIR})

include_directories(${CMAKE_CURRENT_BINARY_DIR})

protobuf_generate_cpp(TENSORFLOW_PROTO_SRCS TENSORFLOW_PROTO_HDRS
        proto/attr_value.proto
        proto/function.proto
        proto/graph.proto
        proto/node_def.proto
        proto/op_def.proto
        proto/resource_handle.proto
        proto/tensor.proto
        proto/tensor_shape.proto
        proto/types.proto
        proto/versions.proto
        )

add_executable(tensorflow2ncnn tensorflow2ncnn.cpp ${TENSORFLOW_PROTO_SRCS} ${TENSORFLOW_PROTO_HDRS})

target_link_libraries(tensorflow2ncnn ${PROTOBUF_LIBRARIES})

find_package(Protobuf REQUIRED) 会自动在系统目录中find protobuf ,需要version 3以上版本

@nihui
Copy link
Member

nihui commented Sep 28, 2017

#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants