Tensorflow won't STFU #12
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Tensorflow 2.13.0 on x86_64, installed from pip, using CPU.
Tensorflow, by default, when run in the scripts outputs lines such as:
This can be supressed by adding lines such as this to python:
As a side note,
birdnetlib
itself is quite noisy, so just getting a list of species spams the console with a bunch ofprints
that can't be controlled with a debug option. In Python, stdout and stderr can be controlled a bunch of different ways, but here's a way to silence birdnetlib:The above silences all unwanted stdout/stderr except this line:
It seems like the above should silence it, or perhaps another option, but nonesuch thing exists, afaict. The only two options are to rebuild tensorflow with debugging off (!!!! insanely tedious to suppress one line of
INFO
) or redirect in the shell ala2>/dev/null
.The line in
species.py
that generates the noise:Others have noted this in tflite as well:
https://github.com/google/mediapipe/issues/3672
https://github.com/google/mediapipe/issues/2094
https://github.com/tensorflow/tensorflow/issues/58050
I don't see that the newly metioned
TFLITE_LOG_SILENT
or a variety of other approaches will silence it. I don't get how Python can't control the stderr of the freaking thing it is loading. Anyhoo.One of the various ways to silence other Tensorflow messages is this:
That doesn't fix this noise though:
Minimal working example:
Outputs:
Wrapping in shell script for now:
This is slightly better, in that it only silences the obnoxious line, not other stderr:
But it breaks using other pipes and redirects when the script is run.
(E.g. the output from that can't be piped to grep to just search for one bird.)