Starting with TensorFlow 2.16, doing pip install tensorflow will install Keras 3.
Therefore, if you make the following installation on a fresh installed Ubuntu 22:
where \<pyod> is the path to the downloaded repository
You ended up with an environment with
Python 3.10.12
tensorflow 2.16.1
keras 3.3.2
Then if you run:
$ cd <pyod>
$ python3 alad_example.py
...
ValueError: A KerasTensor cannot be used as input to a TensorFlow function. A KerasTensor is a symbolic placeholder for a shape and dtype, used when constructing Keras Functional models or Keras Functions. You can only use it as input to a Keras layer or a Keras operation (from the namespaces keras.layers and keras.operations)
The only workaround I find so far is to install using pip install tensorflow>=2.0,<2.16.
right -- due to the complexity and higher overhead to support both tf and torch in PyOD -- we are dropping tf and replacing everything by torch. right now, maybe it is easier to stick with tf2.6
Starting with TensorFlow 2.16, doing
pip install tensorflow
will install Keras 3. Therefore, if you make the following installation on a fresh installed Ubuntu 22:where \<pyod> is the path to the downloaded repository
You ended up with an environment with
Then if you run:
... ValueError: A KerasTensor cannot be used as input to a TensorFlow function. A KerasTensor is a symbolic placeholder for a shape and dtype, used when constructing Keras Functional models or Keras Functions. You can only use it as input to a Keras layer or a Keras operation (from the namespaces
keras.layers
andkeras.operations
)The only workaround I find so far is to install using
pip install tensorflow>=2.0,<2.16
.