WillianFuks / tfcausalimpact

Python Causal Impact Implementation Based on Google's R Package. Built using TensorFlow Probability.
Apache License 2.0
600 stars 72 forks source link

Deprecation Warnings While Running Example #8

Open MichaelMitchellM opened 3 years ago

MichaelMitchellM commented 3 years ago

Hi,

This is a really great package thank you.

When I run the example from the README I get the following three warnings:

WARNING:tensorflow:From /home/michael/.local/lib/python3.8/site-packages/tensorflow/python/ops/linalg/linear_operator_diag.py:167: calling LinearOperator.__init__ (from tensorflow.python.ops.linalg.linear_operator) with graph_parents is deprecated and will be removed in a future version.
Instructions for updating:
Do not pass `graph_parents`.  They will  no longer be used.
WARNING:tensorflow:From /home/michael/.local/lib/python3.8/site-packages/tensorflow/python/ops/linalg/linear_operator_block_diag.py:223: LinearOperator.graph_parents (from tensorflow.python.ops.linalg.linear_operator) is deprecated and will be removed in a future version.
Instructions for updating:
Do not call `graph_parents`.
WARNING:tensorflow:From /home/michael/.local/lib/python3.8/site-packages/tensorflow_probability/python/distributions/distribution.py:298: MultivariateNormalFullCovariance.__init__ (from tensorflow_probability.python.distributions.mvn_full_covariance) is deprecated and will be removed after 2019-12-01.
Instructions for updating:
`MultivariateNormalFullCovariance` is deprecated, use `MultivariateNormalTriL(loc=loc, scale_tril=tf.linalg.cholesky(covariance_matrix))` instead.

Here are my package versions:

tensorflow                     2.4.1               
tensorflow-estimator    2.4.0               
tensorflow-probability  0.12.1
tfcausalimpact              0.0.1

Thanks!

WillianFuks commented 3 years ago

Hi @MichaelMitchellM ,

This does indeed happen. When developing this package I did look for ways to hide the warnings but they happen internally in TensorFlow Probability so I couldn't manage them =/...

Still, those are totally fine. Probably they'll go away with future versions of TF and TFP (but new warnings may come along as well).

If I find some technique to remove them I'll update this package :)

Best,

Will

IvanUkhov commented 3 years ago

The warnings you see are coming from TensorFlow or TensorFlow Probability, and it is their job to eventually update. There is nothing to fix in TFCausalImpact. However, if needed, deprecation warnings can be disabled as follows (outside this package):

import tensorflow.python.util.deprecation as deprecation
deprecation._PRINT_DEPRECATION_WARNINGS = False

All TensorFlow warnings can be disabled as follows:

import logging
import tensorflow
tensorflow.get_logger().setLevel(logging.ERROR)
WillianFuks commented 3 years ago

Hi @IvanUkhov ,

Thanks for sharing this, I did try those a while ago and unfortunately (not quite sure why) it still didn't work. Regardless of what we do with TF's logging the warnings still pops up (I tried setting them right at the beginning of the main code as well still to no avail).