Skip to main content

tfx_bsl (TFX Basic Shared Libraries) contains libraries shared by many TFX (TensorFlow eXtended) libraries and components.

Project description

TFX Basic Shared Libraries

Python PyPI

TFX Basic Shared Libraries (tfx_bsl) contains libraries shared by many TensorFlow eXtended (TFX) components.

This package is not intended for direct use by TFX users, and its APIs should be considered internal to TFX (therefore there is no backward or forward compatibility guarantee) unless otherwise remarked.

Each minor version of a TFX component or TFX itself, if it needs to depend on tfx_bsl, will depend on a specific minor version of it (e.g. tensorflow_data_validation 0.14.* will depend on and only work with tfx_bsl 0.14.*)

Installing from PyPI

tfx_bsl is available as a PyPI package.

pip install tfx-bsl

However it is a dependency of many TFX components and usually as a user you don't need to install it directly.

Build with Docker

If you want to build a TFX component from the master branch, past the latest release, you may also have to build the latest tfx_bsl, as that TFX component might have depended on new features introduced past the latest tfx_bsl release.

Building from Docker is the recommended way to build tfx_bsl under Linux, and is continuously tested at Google.

1. Install Docker

Please first install docker and docker-compose by following the directions.

2. Clone the tfx_bsl repository

git clone https://github.com/tensorflow/tfx-bsl
cd tfx-bsl

Note that these instructions will install the latest master branch of tfx-bsl. If you want to install a specific branch (such as a release branch), pass -b <branchname> to the git clone command.

When building on Python 2, make sure to strip the Python types in the source code using the following commands:

pip install strip-hints
python tfx_bsl/tools/strip_type_hints.py tfx_bsl/

3. Build the pip package

Then, run the following at the project root:

sudo docker-compose build manylinux2010
sudo docker-compose run -e PYTHON_VERSION=${PYTHON_VERSION} manylinux2010

where PYTHON_VERSION is one of {27, 35, 36, 37}.

A wheel will be produced under dist/.

4. Install the pip package

pip install dist/*.whl

Build from source

1. Prerequisites

Install NumPy

If NumPy is not installed on your system, install it now by following these directions.

Install Bazel

If Bazel is not installed on your system, install it now by following these directions.

Install PyArrow

tfx_bsl needs to be built with specific PyArrow versions ( as indicated in third_party/pyarrow.version). Install pyarrow by following these directions.

When installing please make sure to specify the compatible pyarrow version. For example:

pip install "pyarrow>=0.14.0,<0.15.0"

2. Clone the tfx_bsl repository

git clone https://github.com/tensorflow/tfx-bsl
cd tfx-bsl

Note that these instructions will install the latest master branch of tfx_bsl If you want to install a specific branch (such as a release branch), pass -b <branchname> to the git clone command.

When building on Python 2, make sure to strip the Python types in the source code using the following commands:

pip install strip-hints
python tfx_bsl/tools/strip_type_hints.py tfx_bsl/

3. Build the pip package

TFDV uses Bazel to build the pip package from source. Before invoking the following commands, make sure the python in your $PATH is the one of the target version and has NumPy and PyArrow installed.

./configure.sh
bazel run -c opt --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 tfx_bsl:build_pip_package

The flag D_GLIBCXX_USE_CXX11_ABI=0 is to use an older std::string ABI. Which is used by all manylinux2010 compliant wheels (including PyArrow). If you also build PyArrow from source without that flag, you may not need to specify it here.

You can find the generated .whl file in the dist subdirectory.

4. Install the pip package

pip install dist/*.whl

Supported platforms

tfx_bsl is tested on the following 64-bit operating systems:

  • macOS 10.12.6 (Sierra) or later.
  • Ubuntu 16.04 or later.
  • Windows 7 or later.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tfx-bsl, version 0.21.0
Filename, size File type Python version Upload date Hashes
Filename, size tfx_bsl-0.21.0-cp27-cp27m-macosx_10_9_x86_64.whl (2.2 MB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp27-cp27mu-manylinux2010_x86_64.whl (1.9 MB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp35-cp35m-macosx_10_6_intel.whl (2.2 MB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp35-cp35m-manylinux2010_x86_64.whl (1.9 MB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp35-cp35m-win_amd64.whl (1.3 MB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp36-cp36m-macosx_10_9_x86_64.whl (2.2 MB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp36-cp36m-manylinux2010_x86_64.whl (1.9 MB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp36-cp36m-win_amd64.whl (1.3 MB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp37-cp37m-macosx_10_9_x86_64.whl (2.2 MB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp37-cp37m-manylinux2010_x86_64.whl (1.9 MB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size tfx_bsl-0.21.0-cp37-cp37m-win_amd64.whl (1.3 MB) File type Wheel Python version cp37 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page