TFLite cross-compiling arm64 build error? - tensorflow

As I am currently trying to Tensorflow lite for ARM64 architecture, I just try to follow the instructions from below:
https://www.tensorflow.org/lite/guide/build_arm64#cross-compile_for_arm64
But I simply get a compilation error:
tensorflow/lite/tools/make/downloads/ruy/ruy/cpuinfo.cc:9:21: fatal error: cpuinfo.h: No such file or directory
I am surprised this starting build not working out of the box.
Btw, I am trying to do the above in Ubuntu 16.04 VM.
Anybody had the same issues?

Solved now. You need to explicity install Bazel for this.
The tensorflow-lite dependencies script does not do this. Not sure why, should have been part of this.

Related

Error with installation of pycocotools for Detr Tensorflow

I'm trying to use Detr Tensorflow models and need to install pycocotools. On a Windows 10 PC, I'm executing this in a Visual Studio Code. I'm following the steps provided in this
GitHub repo : https://github.com/Visual-Behavior/detr-tensorflow#install
I attempted to pip-install pycocotools and received the following error (fails to construct wheel):
Screenshot of Error
Any idea on how to remove this error ?
The solution is in the error output.
You need to install Microsoft C++ Build Tools.

How to get cmake to enable cuda when compiling yolo (darknet)?

I am currently using the cmake-gui to compile yolo darknet at https://github.com/AlexeyAB/darknet.git. However, it will not enable cuda and I am having a few other odd issues. These include when I run darknet.exe from the Release folder after building it using VS2017, it states that it cannot find pthreadVC2.dll or opencv_world410.dll.
To fix the other issues, I copied the exe and those files and put them all in the root folder of the project. This seems to work but I am not sure why it wouldn't work otherwise.
For cuda, I am not sure what to try. I have these system variables and path:
Here is my cmake-gui:
It can be seen that CMAKE_CUDA_COMPILER is NOTFOUND. Which I am thinking is the problem, but I am not sure why it cannot be found. If I run nvcc -V in the command prompt, it returns:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018
Cuda compilation tools, release 10.0, V10.0.130
Also here is the output for cmake configuration:
Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
OpenCV ARCH: x64
OpenCV RUNTIME: vc15
OpenCV STATIC: OFF
Found OpenCV 4.1.0 in C:/opencv/build/x64/vc15/lib
You might need to add C:\opencv\build\x64\vc15\bin to your PATH to be able to run your applications.
ZED SDK not enabled, since it requires CUDA
Configuring done
If you have any tips for any of these problems, please let me know. Just an FYI, currently darknet does work and if I test it on dog.jpg, it successfully detects the classes. However, this is of course without Cuda or cudnn and I would like to use these eventually. Thank you! If you need anything else from me please let me know!
Unlike above said, i didn't reinstall CUDA, i just copy 4 files from
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\visual_studio_integration\MSBuildExtensions
to
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations
The answer was given by #Andropogon: CUDA has to be reinstalled after Visual Studio.
This is what we found when I dug into it a bit with my colleague:
Similar to OP, all compilation steps seemed to run without error and generate an executable.
Taking a closer look at cmake, under CMAKE/CMAKE_CUDA_COMPILER it said NOT FOUND, despite nvcc.exe being on the Path. (nvcc --version runs fine in Powershell.) We manually entered the location of nvcc.exe to this option, and now configure comes up with a more helpful error message: No CUDA toolset found. with reference to line numbers in various cmake files. Among those lines was this message, which seems to confirm that Visual Studio (VS) is part of the problem,
if(NOT CMAKE_VS_PLATFORM_TOOLSET_CUDA)
message(FATAL_ERROR "No CUDA toolset found.")
So after reinstalling CUDA the compilation looked more like I would expect - but I still get an executable which doesn't appear to do anything (no output on the command line, no prediction.jpg generated). Anyway, hopefully that can shed a bit of light on the CUDA/VS/cmake issue.
I had the same problem, I tried many ways to make GPU available for transe, and finally cmake started to see CUDA when I reinstalled VS2019 (from disk D to disk C) and reinstalled CUDA in version v.10.1. After this, cmake began to find CUDA, and after compiling the project in VS2019, everything start to work correctly.
Important thing to install Visual Studio firstly and later CUDA.

models/research/gan/pix2pix : bazel-bin error no such file or directory

I'm having issue with launch_script.sh for pix2pix sample in models/research/gan/pix2pix
After looking into the script, it stuck at these lines
bazel build "${git_repo}/research/slim:download_and_convert_imagenet"
"./bazel-bin/download_and_convert_imagenet" ${DATASET_DIR}
I've looked up previous questions (both here and Issues in Tensorflow's models repo, and many said that it's because bazel configurations, mismatching between where bazel looks and where bazel generates. But after looking up all directories created by bazel, there's no directories of what I've been missing
I'm doing this on my Azure VM on Linux Ubuntu 16.04. This is my first time working with bazel. So sorry for lack of knowledge in bazel. I'd be very thankful if someone can help solve this problem

How can I build libtensorflow.so for the Tensorflow Rust bindings without SSE?

I've been trying to use the Tensorflow Rust community bindings on Ubuntu 16.04 32bit. The compilation succeeds, and I have a working libtensorflow.so file that
links properly with the Rust program, but as soon as I run the program I get the following error:
F tensorflow/core/platform/cpu_feature_guard.cc:35] The TensorFlow library was compiled to use SSE instructions, but these aren't available on your machine.
I've tried several solutions, and I've successfully gotten the libtensorflow_cc.so shared library to work, but the same solutions that worked for that don't work for the libtensorflow.so shared library. I'm trying to compile the r1.0 tag from the main tensorflow github repository.
The tensorflow.bzl doesn't have the line referenced in this answer, so that solution wouldn't apply. I've also tried compiling with bazel build --copt=-mno-sse ..., but that also did not work. Any ideas as to how to fix this?

Errors when trying to build label_image neural net with bazel

Environment info
Operating System: El Capitan, 10.11.1
I'm doing this tutorial: https://petewarden.com/2016/09/27/tensorflow-for-mobile-poets/
Trying to classify images using tensorflow on iOS app.
When I try to build my net using bazel:
bazel build tensorflow/examples/label_image:label_image
I get these errors:
https://gist.github.com/galharth/36b8f6eeb12f847ab120b2642083a732
From the related github issue https://github.com/tensorflow/tensorflow/issues/6487 I think we narrowed it down to a lack of resources on the virtual machine. Bazel tends to get flakey with only 2GB of RAM allocated to it.