我有一个关于tensorflow移植到Android设备的问题。当我在centos中时,使用bazel编译生成的apk文件,提示以下错误:
错误:/ data / tensorflow-master / WORKSPACE:37:1:'tf_workspace'的语法错误:预期, 错误:/ data / tensorflow-master / WORKSPACE:44:1:关键字arg之后的非关键字arg。 错误:加载包'external'时出错:无法解析WORKSPACE文件。 信息:经过的时间:0.242s
以下是WORKSPACE文件的37-44行:
请在workspace.bzl中添加所有新的TensorFlow依赖项。
37 tf_workspace()
38
39 new_http_archive(
40 name =“inception5h”,
41 build_file =“models.BUILD”,
42 url =“https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip”,
43 sha256 =“d13569f6a98159de37e92e9c8ec4dae8f674fbf475f69fe6199b514f756d4364”
44)
我问你遇到过类似的问题吗?请帮帮我。答案 0 :(得分:0)
我遇到了同样的问题,这就是我修复它的方法:
# Uncomment and update the paths in these entries to build the Android demo.
android_sdk_repository(
name = "androidsdk",
api_level = 24,
# # Ensure that you have the build_tools_version below installed in the
# # SDK manager as it updates periodically.
build_tools_version = "25.0.3",
# # Replace with path to Android SDK on your system
path = "/home/yours/Android/Sdk/",
) #my mistake #) --> )
#
# Android NDK r12b is recommended (higher may cause issues with Bazel)
android_ndk_repository(
name="androidndk",
path="/home/yours/android-ndk-r12b/",
# # This needs to be 14 or higher to compile TensorFlow.
# # Note that the NDK version is not the API level.
api_level=14)