bazel

Mapping from Maven standard directory to Bazel for test resources

爷,独闯天下 提交于 2019-12-04 03:55:00
问题 We have test dependency files in src/test/resources per the Maven Standard Directory Layout. These test files end up in the JAR and on the classpath when test classes fetch them via, e.g. Resources#asCharSource. What is the preferred way in Bazel to depend to test files and have them appear in the classpath? I have the following in my src/test/resources/BUILD : filegroup( name = "test-deps", testonly = 1, srcs = glob(["*.txt"]), visibility = ["//visibility:public"], ) And the following in my

TF_Serving 部署一个模型

我只是一个虾纸丫 提交于 2019-12-04 03:43:15
参考: 1、 https://tensorflow.google.cn/ 2、 https://www.tensorflow.org/ 3、 http://note.youdao.com/noteshare?id=92af08c5ceff28db9748f822fee05322&sub=7E5B724B2443405C9DD3D8E22C3A1EE9 TF_Serving安装参考: http://blog.csdn.net/wc781708249/article/details/78594750 本教程将向您介绍如何使用TensorFlow Serving组件导出经过训练的TensorFlow模型,并使用标准tensorflow_model_server来提供它。 如果您已经熟悉TensorFlow Serving,并且您想了解更多有关服务器内部工作方式的信息,请参阅 TensorFlow Serving高级教程 。 本教程使用TensorFlow教程中介绍的简单Softmax回归模型进行手写图像(MNIST数据)分类。 如果您不知道TensorFlow或MNIST是什么,请参阅 MNIST For ML Beginners教程 。 本教程的代码由两部分组成: 训练并导出模型的Python文件 mnist_saved_model.py 。 ModelServer二进制文件

C++ project with Bazel and GTest

拟墨画扇 提交于 2019-12-03 16:44:51
问题 I want to create a Bazel C++ project with gtest for unit tests. What is the minimal setup? (I only have Bazel installed on my computer and I am running under Linux) 回答1: The project structure is: . ├── bin │ ├── BUILD │ ├── hello.cpp ├── MyLib │ ├── BUILD │ ├── message.hpp │ ├── message.cpp │ ├── ... ├── test │ ├── BUILD │ ├── message_test.cpp │ ├── ... ├── gmock.BUILD └── WORKSPACE Files related to Bazel+GTest WORKSPACE There you download gtest from github: new_git_repository( name =

RustCon Asia 实录 | Rust 在国内某视频网站的应用

爱⌒轻易说出口 提交于 2019-12-03 15:34:47
作者介绍: hawkingrei(王维真) ,中间件高级开发工程师,开源爱好者,TiDB & TiKV Contributor。 WaySLOG(雪松) ,Rust 铁粉一枚,专注中间件,bug creator。 本文根据 hawkingrei & WaySLOG 在 首届 RustCon Asia 大会 上的演讲整理。 今天我们会和大家聊聊 Rust 在我们公司的二三事,包括在公司产品里面用的两个工具,以及雪松(WaySLOG)做的 Cache Proxy —— Aster 的一些经验。 <center>图 1</center> 十年前,我司刚刚成立,那时候其实很多人都喜欢用 PHP 等一些动态语言来支持自己的早期业务。用动态语言好处在于开发简单,速度快。但是动态语言对代码质量、开发的水平的要求不是很高。所以我来到公司以后的第一个任务就是把我们的 PHP 改写成 Golang 业务。在我看了当时 PHP 的代码以后的感受是:动态语言一时爽,代码重构火葬场。因为早期我司还是个人网站,PHP 代码质量比较差,代码比较随意,整套系统做在了一个单体的软件里,我们称这个软件是一个全家桶,所有的业务都堆在里面,比较恶心。所以导致早期我司的服务质量也是非常差,观众给我们公司一个绰号叫「小破站」。 但是随着规模越来越大,还上市了,如果还停留在「小破站」就十分不妥,因此我们开始用 Golang

TensorFlow Bazel build failing

三世轮回 提交于 2019-12-03 14:22:25
I'm building TensorFlow with Bazel using bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer as instructed to by the TensorFlow 'installing from sources' instructions . I get the following error: ERROR: /home/ubuntu/tensorflow/tensorflow/stream_executor/BUILD:5:1: C++ compilation of rule '//tensorflow/stream_executor:stream_e xecutor' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command third_party/gpus/crosstool/clang/bin/crosstool _wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set

Bazel environment variables in build rules

邮差的信 提交于 2019-12-03 11:19:46
问题 I want to refer to a DirectX SDK in the BUILD file. The problem is that (as far as I understand) Bazel supports passing environment variables only through --action_env=DXSDK_DIR argument for Bazel and it is meant to be used in actions, which must be defined in a plugin ( .bzl file). Is there any easier way to refer to the environment variable by using it as Make variable ( includes = [ "$(DXSDK_DIR)/Include" ] ) or do I need to write a plugin? 回答1: In principle you need a cc_library rule

Tensorflow won&#039;t build with CUDA support

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've tried building tensorflow from source as described in the installation guide . I've had success building it with cpu-only support and with the SIMD instruction sets, but I've run into trouble trying to build with CUDA support. System information: Mint 18 Sarah 4.4.0-21-generic gcc 5.4.0 clang 3.8.0 Python 3.6.1 Nvidia GeForece GTX 1060 6GB (Compute capability 6.1) CUDA 8.0.61 CuDNN 6.0 Here's my attempt at building with CUDA, gcc, and SIMD: kevin@yeti-mint ~/src/tensorflow $ bazel clean INFO: Starting clean (this may take a while).

How to resolve bazel “undeclared inclusion(s)” error?

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to bazel, and I'm getting a failure to build my C++ package with ERROR: /path/to/package/BUILD:linenumber:1 undeclared inclusion(s) in rule '//path/to/package:name': this rule is missing dependency declarations for the following files included by 'path/to/package/source_file.cpp' ...followed by a list of header files in a different directory. These files are not part of the package that is being built, but are being pulled in from elsewhere. My question is how to properly add the declaration to the BUILD file to resolve the error?

C++ project with Bazel and GTest

白昼怎懂夜的黑 提交于 2019-12-03 05:51:07
I want to create a Bazel C++ project with gtest for unit tests. What is the minimal setup? (I only have Bazel installed on my computer and I am running under Linux) The project structure is: . ├── bin │ ├── BUILD │ ├── hello.cpp ├── MyLib │ ├── BUILD │ ├── message.hpp │ ├── message.cpp │ ├── ... ├── test │ ├── BUILD │ ├── message_test.cpp │ ├── ... ├── gmock.BUILD └── WORKSPACE Files related to Bazel+GTest WORKSPACE There you download gtest from github: new_git_repository( name = "googletest", build_file = "gmock.BUILD", remote = "https://github.com/google/googletest", tag = "release-1.8.0", )

How to use transform_graph to optimize Tensorflow model

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I used to use the optimize_for_inference library in optimizing frozen Tensorflow models. However, I have read from different sources that Tensorflow no longer supports it. I came across transform_graph , and its documentation is found here: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/graph_transforms#strip_unused_nodes At first, I ran into errors and found out that I need to install Tensorflow from source ( https://www.tensorflow.org/install/install_sources#install_the_pip_package ) instead of using PIP. I already