bazel

编译 TensorFlow 的 C/C++ 接口

老子叫甜甜 提交于 2020-10-18 13:52:19
TensorFlow 的 Python 接口由于其方便性和实用性而大受欢迎,但实际应用中我们可能还需要其它编程语言的接口,本文将介绍如何编译 TensorFlow 的 C/C++ 接口。 安装环境: Ubuntu 16.04 Python 3.5 CUDA 9.0 cuDNN 7 Bazel 0.17.2 TensorFlow 1.11.0 1. 安装 Bazel 安装 JDK sudo apt-get install openjdk-8-jdk 添加 Bazel 软件源 echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - 安装并更新 Bazel sudo apt-get update && sudo apt-get install bazel 点此查看 Bazel 官方安装指南 2. 编译 TensorFlow 库 点此下载 TensorFlow 源码 进入源码根目录,运行 ./configure 进行配置。可参考 官网 -> Build from

尝试过把配置放在编程语言代码里吗?比YAML爽

大憨熊 提交于 2020-08-12 04:48:45
本文将试着解释为什么大多数配置格式用起来都不太舒服,作者建议大家尝试使用一门真正的编程语言(例如,像 Python 这样的通用编程语言)来编写配置,通常这是一种可行的选择,且使用过程更感愉悦。 大多数现代配置格式都很糟糕 本节,我主要针对 JSON/YAML/TOML/ini 文件,这是我遇到过最常见的配置格式。 我们暂将这种配置称为常见配置(如果有更好的名字,欢迎在评论中留言,谢谢)。 大家可能遇到过如下情况: JSON 没有注释, 设计如此 大量配置无法重用 例如,虽然 YAML 在理论上支持重用 / 引用配置(他们称之为 锚 ),但有些软件(如 Github Actions )却并不支持。通常,开发者无法重用配置的一部分,必须复制粘贴。 .gitconfig 使用一个 自定义语法 来合并这些配置 不能包含任何逻辑 很多人认为这是一种积极的做法,但我认为,如果不能定义临时变量、辅助函数、替换字符串或连接列表,那就有点差劲。变通方法(如果有的话)通常也不好用,因为它们额外增加了认知开销。于是,出现了一批 重新发明 的编程语言: 变量和字符串插值:Ansible 使用 Jinja 模板 (!) 进行变量操作。 Github Actions 为此使用了 自定义语法 此外,他们有 自己的 一套函数来处理变量。你得为此学习一门从来都未曾想过要学习的新语言。 范围 例如,在 Github

教你从头到尾利用DL学梵高作画:GTX 1070 cuda 8.0 tensorflow gpu版

我只是一个虾纸丫 提交于 2020-08-04 13:34:25
教你从头到尾利用DL学梵高作画 作者:七月在线开发/市场团队中的三人,骁哲、李伟、July。本教程主要由骁哲撰写,李伟负责Linux命令部分。 时间:二零一六年九月二十五日 配置:GTX 1070 cuda 8.0 Ubuntu 14.04 cudnn 5.1 tensorflow gpu 交流:TensorFlow实战交流Q群 472899334,有问题可以加此群共同交流。另探究实验背后原理,请参看我们的深度学习在线课程: 深度学习在线班 。 一、前言 12年本博客推出SVM三层境界,14年July团队开始做机器学习线下班,也因此写了一系列ML博客。15年,July团队正式创业,开始做 七月在线 —— 国内领先的人工智能教育平台,最初涵盖算法、机器学习、深度学习三大重心。16年,七月在线从上半年的5个课程扩展到下半年的30个课程,讲师团队也从上半年的5人扩大至现有的19人(且到18年上半年,讲师团队已超过60人)。 与此同时,机器学习越来越火,且随着计算机计算能力的提高深度学习则更趋火热。公司在做深度学习的课程时,开发/市场同事也会顺带着学习学习,但从始至终都尚未跟着课程上的实验实际动手做过。 直到最近,我们团队人手渐渐齐了之后,发现可以动手做一些实验了。为何呢?学一个东西,懂它理论之后,最重要的是付诸实践,动手实验一把,不然永远只是纸上谈兵。 我们三虽然都不讲课

ubuntu16.04编译segmap

被刻印的时光 ゝ 提交于 2020-07-29 11:32:13
环境依赖:PCL1.9 tensorflow1.8.0 ros (pcl1.9 及 ros自行配置 ros配置时推荐用国内源) 2020年最近rosdep不易成功具体方法需要 sudo gedit /etc/resolv.conf 删掉其中所有内容替换为 nameserver 8.8.8.8 #google域名服务 nameserver 8.8.4.4 #google域名服务器 下面开始正题 一、下载源码及虚拟环境 $ sudo apt-get install python-wstool doxygen python3-pip python3-dev python-virtualenv dh-autoreconf $ cd ~/segmap_ws $ catkin init $ catkin config --merge-devel $ catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release $ cd src $ git clone https://github.com/ethz-asl/segmap.git $ wstool init $ wstool merge segmap/dependencies.rosinstall $ wstool update $ virtualenv ~/segmappyenv $ source

Does bazel support remote execution on different platforms?

隐身守侯 提交于 2020-07-08 20:33:08
问题 Specifically, I want to run tests on Windows workers from a Mac host. Comments on running bazel remote executor test on separate machines indicate that it is something that Bazel team is working on, but want to confirm. 回答1: Just give it a try! Build and run local remote execution worker on your Windows 10 machine: git clone https://github.com/bazelbuild/bazel.git cd bazel bazel build src/tools/remote:worker bazel-bin/src/tools/remote/worker --work_path=/tmp/test --listen_port=8080 bazel-out

How to pass variables to Bazel target build?

左心房为你撑大大i 提交于 2020-06-27 18:11:04
问题 I am trying to build a Docker image with this code: container_image( name = "docker_image", base = "@java_base//image", files = [":executable_deploy.jar"], cmd = ["java", "-jar", "executable_deploy.jar"], env = { "VERSION" : "$(VERSION)" } ) I want to pass a variable to the target built so it can be replaced in $(VERSION). Is this possible? I have tried with VERSION=1.0.0 bazel build :docker_image , but I get an error: $(VERSION) not defined. How can I pass that variable? According docs: The

How to run all tests in Bazel from a single java_test() rule?

独自空忆成欢 提交于 2020-06-25 09:31:04
问题 I am adding tests in Bazel, but I don't want to write a test rule for every single test file. However, each test rule requires a test_class - the test class that is being ran, so there is no easy way to just run all tests with a single java_test rule. Is there a work around for where I wouldn't need to specify a test_class and just run all tests at once? 回答1: You can write a JUnit test suite class, which will run your other tests. For example, if you have test classes Test1.java and Test2

Building Tensorflow Java Maven dependency for upload in internal repo

假装没事ソ 提交于 2020-06-25 05:45:09
问题 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