Docker多阶段构建是17.05以后引入的新特性,旨在解决编译和构建复杂、镜像太大的问题。因此要使用多阶段构建特性必须使用高于或等于17.05的Docker。
Python: Decorator
Posted on
|
Edited on
|
In
Tutorial
Python 的修饰器的英文名叫 Decorator, 当你看到这个英文名的时候, 你可能会把其跟 Design Pattern 里的 Decorator 搞混了, 其实这是完全不同的两个东西. 在介绍装饰器之前, 我们先来点直观的认识, 下面一个 Python 修饰器的示例代码
1 | def tags(tag_name): |
运行这段代码时, 会有如下输出
1 | <div><p><span>Hello John</span></p></div> |
Merging Models for TensorFlow Serving
Posted on
|
Edited on
|
In
Tool
This tool can merge TensorFlow frozen models(.pb
file) into the same model. The advantage of doing this is that
- When deploying, you only need to place the updated version of the model(merged model) in the corresponding location without restart the TensorFlow Serving service.
- Hot switching can be done easily. That is, the service will not be interrupted when updating the model.
See more details on GitHub.
Usage
- Put frozen models(
.pb
file) into./frozen
directory. - Add serving information in
export_serving_model.py
.- Set update messages
UPDATE_MESSAGE
. - Define a export(merging) function.
- Put
ServingInfo.export
decorator on export function(if not, then this model will not export).
- Set update messages
- Run
export_serving_model.py
. - Copy the serving model
./serving/{version}
to your serving model directory on the server, it will be automatically loaded. - Call it by RPC, such as gRPC.
Commonly Used Docker Commands
Posted on
|
Edited on
|
In
Tutorial
常用的 Docker 命令
本文集中了一些常用的 Docker 命令, 详细还请查看 官方文档.
- 查看容器:
docker ps
- 查看镜像:
docker images
- 运行镜像:
docker run <IMAGE>
- 进入容器:
docker exec -t -i <CONTAINER> /bin/bash
LabelMe-Docker: Online Annotaion Tool Docker Image
Posted on
|
Edited on
|
In
Tool
LabelMe 是一个用 Javascript 编写的图像标注工具, 可以用于 在线 图像标注. 也就是说, LabelMe 可以部署在服务器, 然后使用浏览器进行访问.
与传统图像标注工具相比, 优势在于可以从任何地方访问该工具, 而且不需要在自己机器上安装或复制整个大型数据集. 它有如下优势
- 添加待标图片和获取标注结果方便.
- 降低外包人员招聘成本: 之前需要招聘专职标注人员到公司进行标注, 招聘难度大.
- 降低标注成本: 因为能够远程标注, 自由度高, 可以适当降低标注价格.
- 降低标注数据泄露的风险: 待标图片和标注结果均在服务器上.