Skip to main content

Simple python package to shut up Tensorflow warnings and logs.

Project description

travis sonar_quality sonar_maintainability sonar_coverage Maintainability pip

Simple python package to shut up Tensorflow warnings and logs.

How do I get it?

As usual, just install it from pip:

pip install silence_tensorflow

This package WILL NOT install Tensorflow with it, as often custom versions are needed for each setup.

How do I use it?

You only need to import the package before import Tensorflow:

import silence_tensorflow
import tensorflow as tf

...

# your code

How does this work under the hood?

This package will set the KMP_AFFINITY system variable to “noverbose”, TF_CPP_MIN_LOG_LEVEL to level 2 (only errors logged) and silence both FutureWarning and FutureWarning.

If you need a custom value for KMP_AFFINITY you should reset it after importing the package, as follows:

import os
backup = os.environ["KMP_AFFINITY"]
import silence_tensorflow
os.environ["KMP_AFFINITY"] = backup

Project details


Download files

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

Source Distribution

silence_tensorflow-1.0.0.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file silence_tensorflow-1.0.0.tar.gz.

File metadata

  • Download URL: silence_tensorflow-1.0.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.13.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for silence_tensorflow-1.0.0.tar.gz
Algorithm Hash digest
SHA256 91cb4a6bda2350e8622c6451422ffdf85c4a2d599f85b3ae3509c37a1b28ad24
MD5 58e0104b468b975d2d6424e1274360ad
BLAKE2b-256 716da34b9c8d1c905e68b32c667370a253e391b287e80a2db21cce75bd144a07

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page