一组实用程序,可以更轻松地使用bender。

benderthon的Python项目详细描述


一组易于使用的实用程序 Bender

目前支持tensorflow和caffe,但我们正在努力 更多的东西!

使用TensorFlow 1.2+在Python2.7.+和3.+上工作。

要安装:

pip install benderthon

TensorFlow也是必需的。最简单的安装方法是:

pip install tensorflow

还有其他方法,请参见Installing Tensorflow。本登没有 默认情况下安装它以允许使用自定义安装。

tf冻结

tensorflow检查点转换为最小冻结的实用程序

使用量

checkpoint_path.ckpt中获取检查点,其输出为 由名为Tanh的节点生成,并将其保存到 graph_with_weights.pb

benderthon tf-freeze checkpoint_path.ckpt graph_with_weights.pb Tanh

样本

文件sample.py包含mnist数据集的网络示例 2个卷积层和2个密度层。如果你运行它,它会 生成前缀为checkpoints/mnist.ckpt

的检查点文件
./sample.py

然后你可以得到一个最小的protobuf版本,重量被冻结:

benderthon tf-freeze checkpoints/mnist.ckpt output/mnist.pb Prediction

生成的文件占用原始检查点(26MB到 13MB)。

您还可以只得到图形,它只占用13kb

benderthon tf-freeze --no-weights checkpoints/mnist.ckpt output/mnist_only_graph.pb Prediction

要将权重保存在单独的路径中以供以后处理:

benderthon tf-freeze --only-weights checkpoints/mnist.ckpt weights/ Prediction

咖啡冷冻

无法从命令行实用程序访问此模块,它应该 从python代码中使用,导入benderthon.caffe_freeze

您需要首先安装caffeflow包:

pip install -e git://github.com/xmartlabs/caffeflow.git@4618f89#egg=caffeflow

开发

此实用程序正在开发中,并且api不稳定。所以,做吧 不太依赖它。

要在本地安装,您应该执行./setup.py install,但首先 pandocpypandoc已安装。

许可证

Copyright 2017 Xmartlabs SRL.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
无法使用windows x86上的Java验证在linux x64上签名的数字签名   java Firebase通过键从子级检索数据   Java缓存网络文件   java独立jdbcpool实现内存泄漏   java为什么MVN在成功构建时返回1?   java maven正在抛出BoundsException数组   Java:是否可以有“嵌套”映射方法(Java.util.stream)?   java无法使用GSON解析JSON文件   java Spring Groovy集成   java使用SAX解析器,需要所有xml元素(在特定元素下)作为字符串   java列出内容提供商Android 3.1中的内容   java如何使用带有spring api的JPA查询进行软删除?   java隐藏我的socket构造函数以隐藏IP和端口   Java将(JEP359)记录为Spring控制器请求和响应DTO   java在数组中循环时忽略空值   RESTAPI端点的java发现模式   java HTTPs在jmeter中发布带有头的请求测试,并将测试结果保存在mongodb中,并在grafana中显示