Skip to main content

Simple python package to shut up Tensorflow warnings and logs.

Project description

Travis CI build SonarCloud Quality SonarCloud Maintainability Codacy Maintainability Maintainability Pypi project Pypi total project downloads

Simple python package to shut up Tensorflow warnings and logs.

How do I install this package?

As usual, just download it using pip:

pip install silence_tensorflow

Tests Coverage

Since some software handling coverages sometimes get slightly different results, here’s three of them:

Coveralls Coverage SonarCloud Coverage Code Climate Coverate

How do I use it?

You only need to import the package before import Tensorflow:

from silence_tensorflow import silence_tensorflow
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 3 (only errors logged) and silence both FutureWarning and DeprecationWarning.

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

import os
from silence_tensorflow import silence_tensorflow
backup = os.environ["KMP_AFFINITY"]
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.1.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: silence_tensorflow-1.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for silence_tensorflow-1.1.0.tar.gz
Algorithm Hash digest
SHA256 aa522ff65d86b5128a722e7dadc69291d7efa4d417af6a8b930bb204266d9771
MD5 55e0ecbe56eb17cf9f63c885b830b5e3
BLAKE2b-256 0a7733654280aa526c0778e4ddca4c12f9a909a909eb32baee2bb1492b543902

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