benderthon
Set of utilities to work easier with Bender.
Currently there’s support for TensorFlow and Caffe, but we are working on more stuff!
Works on Python 2.7.+ and 3.+, with Tensorflow 1.2+.
To install:
pip install benderthon
TensorFlow is required too. The simplest way to install it is:
pip install tensorflow
There are other ways, see Installing Tensorflow. Benderthon does not install it by default to let the usage of a custom installation.
tf-freeze
Utility to convert TensorFlow checkpoints into minimal frozen graphs.
Usage
To take the checkpoint in checkpoint_path.ckpt, whose output is yielded by the node named Tanh, and save it to graph_with_weights.pb:
benderthon tf-freeze checkpoint_path.ckpt graph_with_weights.pb Tanh
Sample
The file sample.py contains a network example for MNIST dataset with 2 convolutional layers and 2 dens layers. If you run it, it will generate checkpoints files with prefix checkpoints/mnist.ckpt:
./sample.py
Then you can get a minimal protobuf version with the weights frozen:
benderthon tf-freeze checkpoints/mnist.ckpt output/mnist.pb Prediction
The generated file occupies half the original checkpoints (26MB to 13MB).
You can also get only the graph, which occupies just 13kB:
benderthon tf-freeze --no-weights checkpoints/mnist.ckpt output/mnist_only_graph.pb Prediction
To save the weights in a separate path for later processing:
benderthon tf-freeze --only-weights checkpoints/mnist.ckpt weights/ Prediction
caffe-freeze
This module cannot be accessed from the command line utility, it should be used from Python code, importing benderthon.caffe_freeze.
You need caffeflow package installed first:
pip install -e git://github.com/xmartlabs/caffeflow.git@4618f89#egg=caffeflow
Development
This utility is under development and the API is not stable. So, do not heavily rely on it.
To install locally you should do ./setup.py install, but first have pandoc and pypandoc installed.
License
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.
Metadata
Release files for benderthon 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| benderthon-0.3.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for benderthon-0.3.0-py2.py3-none-any.whl |
Release files / benderthon-0.3.0-py2.py3-none-any.whl
| Download URL | benderthon-0.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
bd02b42bccb5ba2e00e6518036449e2c17c784518a6dd358dd4b69f83a8f24f0
|
|
BLAKE2b-256 checksum How to use checksums |
d6410388ce95d9e8ec6c452c4af2d259f18a1fec9f4318250379fd28164b34f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for benderthon 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.