GPflow / GPflowOpt

Bayesian Optimization using GPflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Several deprecation warnings from NumPy and Tensorflow

ronald-jaepel opened this issue · comments

When running the firststeps example I get several deprecation warnings. The environment is a fresh virtual conda environment on Win 10 x64 with the following package versions: packages.txt

First the tensorflow warnings:

WARNING:tensorflow:From [envpath]\lib\site-packages\tensorflow\python\ops\control_flow_ops.py:423: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.

WARNING:tensorflow:From [envpath]\lib\site-packages\tensorflow\python\ops\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.

WARNING:tensorflow:From [envpath]\lib\site-packages\gpflowopt\acquisition\ei.py:76: Normal.__init__ (from tensorflow.python.ops.distributions.normal) is deprecated and will be removed after 2019-01-01.
Instructions for updating:
The TensorFlow Distributions library has moved to TensorFlow Probability (https://github.com/tensorflow/probability). You should update all references to use `tfp.distributions` instead of `tf.distributions`.

WARNING:tensorflow:From [envpath]\lib\site-packages\tensorflow\python\ops\distributions\normal.py:160: Distribution.__init__ (from tensorflow.python.ops.distributions.distribution) is deprecated and will be removed after 2019-01-01.
Instructions for updating:
The TensorFlow Distributions library has moved to TensorFlow Probability (https://github.com/tensorflow/probability). You should update all references to use `tfp.distributions` instead of `tf.distributions`.

This FutureWarning is raised by NumPy:

FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.

It occurs at the following four places during the example-script execution.

[envpath]\lib\site-packages\gpflowopt\acquisition\acquisition.py:193: 
  return self.models[0].X.value, np.hstack(map(lambda model: model.Y.value, self.models))

[envpath]\lib\site-packages\gpflowopt\domain.py:97: FutureWarning: 
  return np.vstack(map(lambda p: p.value, self._parameters)).T

[envpath]\lib\site-packages\gpflowopt\bo.py:150: 
  evaluations = np.hstack(map(lambda f: f(X), fxs))

[envpath]\lib\site-packages\gpflowopt\acquisition\acquisition.py:193: 
  return self.models[0].X.value, np.hstack(map(lambda model: model.Y.value, self.models))

I don't know if you were aware of these warnings, but I wanted to inform you just in case. Sadly I can't help with future-proofing as my coding skills are far too limited.

Thank you for the great package you've developed!

I can confirm that these warnings do still appear, can this issue be resolved soon?

These warnings should be relatively easy to fix. I'm just wondering if GPFlow 0.5.0 itself also generates warnings? In general we try to depend on the same tensorflow and numpy versions as GPFlow (in this case 0.5.0). If GPFlow 0.5.0 works with the latest TF and numpy without problem, then we can look at it.

However, ideally we would like to move to GPFlow and TF 2.0 as soon as they are released, assuming they will fix the current problems we have with GPFlow 1.x.