bazel

Building Tensorflow Java Maven dependency for upload in internal repo

无人久伴 提交于 2020-06-25 05:45:06
问题 I'm doing an in-house build of Tensorflow with CPU optimizations (AVXx, SSE4.x, etc.), so I can use it in Java micro service, which so far is successful, but I have to manually copy files. I want to produce a Maven artifact, which will be uploaded to our internal Maven repo. I'm trying to compile something of these scripts(ci_build) and docs(maven, java ), but I was wondering if there is less hack-ish way? So far was able to build maven dependency, containing only Java API jar with: git

Add custom folders to classpath in bazel java tests

青春壹個敷衍的年華 提交于 2020-06-16 05:01:32
问题 I'm trying to migrate a large codebase from maven to bazel and I've found that some of the tests write to target/classes and target/test-classes and the production code reads it as resources on the classpath. This is because maven surefire/failsafe run by default from the module directory and add target/classes and target/test-classes to the classpath. For me to migrate this large codebase the only reasonable solution is to create target, target/classes and target/test-classes folders and add

How to build TensorFlow Lite as a static library and link to it from a separate (CMake) project?

佐手、 提交于 2020-05-25 23:46:29
问题 I've successfully built a simple C++ app running TF Lite model by adding my sources to tensorflow/lite/examples , similarly to what the official C++ TF guide suggests for full TF. Now I want to build it as a separate project (shared library) linking to TF Lite statically and using CMake as a build system. I tried to add a custom target to my CMakeLists.txt , which would build TF Lite with Bazel: set(TENSORFLOW_DIR ${CMAKE_SOURCE_DIR}/thirdparty/tensorflow) add_custom_target(TFLite COMMAND

output '_coverage/_coverage_report.dat' was not created when using bazel coverage to generate lcov coverage file

∥☆過路亽.° 提交于 2020-05-15 08:12:14
问题 I am using bazel to manage our golang project and I found an option online that I can generate coverage html file by generating a lcov coverage.dat file first and then use genhtml to generate the html. However, I cannot get the first step successfully. The command that I ran is bazel coverage //common/model/foobar:go_default_test --test_output=all --combined_report=lcov --coverage_report_generator=@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools

How to specify output artifact from a cc_library in bazel?

安稳与你 提交于 2020-05-15 05:21:05
问题 I want to build "foo.c" as a library and then execute "readelf" on the generated .so but not the ".a", how can I write it in bazel? The following BUILD.bazel file doesn't work: cc_library( name = "foo", srcs = ["foo.c"], ) genrule( name = "readelf_foo", srcs = ["libfoo.so"], outs = ["readelf_foo.txt"], cmd = "readelf -a $(SRCS) > $@", ) The error is "missing input file '//:libfoo.so'". Changing the genrule's srcs attribute to ":foo" passes both the ".a" and ".so" file to readelf, which is not

Failing to Bazel build C++ project with tensorflow as a dependency

不打扰是莪最后的温柔 提交于 2020-05-15 03:35:16
问题 I see a lot of tutorials that explain how to build projects inside Tensorflow's Bazel WORKSPACE (like this one). But I can't seem to be able to find a way to build my own project and include tensorflow as a dependency. I looked at this Bazel documentation, and there is clearly a way to build with external dependencies, which I tried to follow myself. (since tf is also built with bazel). Here is what my directory structure looks like: . ├── perception │ ├── BUILD │ └── graph_loader.cc ├──

Bazel 编译工具; tensorflow 编译

戏子无情 提交于 2020-04-26 08:28:56
什么是bazel https://docs.bazel.build/versions/master/bazel-overview.html 使用 bazel 构建 c++ 工程 https://github.com/bazelbuild/examples/tree/master/cpp-tutorial https://docs.bazel.build/versions/master/tutorial/cpp.html https://docs.bazel.build/versions/master/bazel-and-cpp.html bazel 函数描述: https://docs.bazel.build/versions/master/be/overview.html 使用bazel 构建tensorflow: https://github.com/tensorflow/tensorflow https://github.com/tensorflow/custom-op https://www.tensorflow.org/install/source (官方网站编译教程,有较为详细的编译步骤) tensorflow bazel 编译命令: (编译cpu支持的版本,限制编译的内存为2GB, 并兼容旧版本的ABI) bazel build --config=opt /

【3D】姿态检测网络PoseCNN复现过程记录

纵然是瞬间 提交于 2020-04-07 14:50:14
最近在研究室内6D姿态检测相关问题,计划在PoseCNN网络基础上进行改进实现。但是在第一步的复现过程中踩了无数的坑,最终成功运行了demo,但目前数据集train还是遇到了一些问题。有问题欢迎一起交流进步! 本文重点讲解网络代码复现过程,对于原文的讲解可以阅读这篇文章,满满干货! 《论文笔记——PoseCNN》 本人系统环境: Ubuntu 16.04 Tensorflow 1.8(from source) Python 2.7 Cuda 10.1 & cuddn 7.3.1 1.搭建虚拟环境 第一步,创建专属于PoseCNN的虚拟环境,之后install的包都在此虚拟环境中。 虚拟环境的好处不用多说了吧,反正对Ubuntu系统的折腾越少越好!!! 我用 conda 创建的环境: conda create -n posecnn python=2.7 激活环境: conda activate posecnn 如果不用这个环境,记得deactivate: conda deactivate posecnn 2.pip install pip install opencv-python 如果不行试一下: sudo apt-get install libopencv-dev pip install mock enum34 pip install matplotlib numpy keras

How to use select to properly detect whether I am building C++ code in Windows or Linux?

主宰稳场 提交于 2020-04-05 15:54:20
问题 I am writing a sample C++ project that uses Bazel to serve as an example idiom for other collaborators to follow. Here is the repository: https://github.com/thinlizzy/bazelexample I am interested to know if I am doing it 'right', more specifically about this file: https://github.com/thinlizzy/bazelexample/blob/38cc07931e58ff5a888dd6a83456970f76d7e5b3/demo/BUILD when regarding to pick particular implementations. cc_library( name = "demo", srcs = ["demo.cpp"], deps = [ "//example:frontend", ],

Bazel-buildfarm - specifying concurrency of worker

一曲冷凌霜 提交于 2020-03-25 18:39:32
问题 I am trying to build TensorFlow using bazel-buildfarm. I have a server and a single worker setup using the example configurations available at https://github.com/bazelbuild/bazel-buildfarm (see examples/ directory). The lone worker is on a 72-core machine. The problem I'm having is that once I kick off a build, although the build targets are being successfully dispatched to the worker, the worker is not taking advantage of all my cores (not even close). I tried explicitly setting --jobs=100