深度學習(五十七)tensorflow andorid yolo物體檢測測試
阿新 • • 發佈:2019-02-14
一、修改tensorflow/workspace檔案,取消android相關注釋:
# 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.2", # Replace with path to Android SDK on your system path = "/home/research/Android/Sdk", ) # # Android NDK r12b is recommended (higher may cause issues with Bazel) android_ndk_repository( name="androidndk", path="/home/research/Android/Sdk/ndk-bundle", # This needs to be 14 or higher to compile TensorFlow. # Note that the NDK version is not the API level. api_level=14)
二、修改 android:build.gradle 中bazel路徑,預設的是如下的:
def bazelLocation = '/usr/local/bin/bazel'
但是在該路徑下並沒有bazel,因此會報如下錯:
Error:Execution failed for task ':buildNativeBazel'.
A problem occurred starting process 'command '/usr/local/bin/bazel''
此時只需要把路徑改成你的bazel路徑就好,比如我的是:def bazelLocation = '/usr/bin/bazel'
三、程式碼結構:基類Classifier.java,三個子類: