-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Setting up Keras and Tensorflow for Neural net Based models
PyOD includes some neural network based models written in Keras, such as AutoEncoder. However, you may find that after pip install pyod, AutoEncoder models do not run. This is expected because we do not want PyOD relies on too many packages, and not everyone needs to run neural nets.
If you want to run neural-net based models, please first install Keras + a backend library, e.g., tensorflow. Either of the following two should do the installation for you:
pip install keras tensorflow or pip install keras tensorflow
conda install keras tensorflow or pip install keras tensorflow
If you have tensorflow-gpu installed, keras would automatically run with GPU. You need tensorflow-gpu if your device have GPU and want to leverage it, otherwise a normal version TensorFlow should be totally fine.
pip install keras tensorflow or pip install keras tensorflow-gpu
conda install keras tensorflow or pip install keras tensorflow-gpu
You can also check this issue for working TF and keras version: https://github.com/yzhao062/pyod/issues/219
Here are some potential error messages you may encounter:
- ModuleNotFoundError: No module named 'theano'
In this case, you should specify keras backend to the one you want to use, e.g., TensorFlow Go to $HOME/.keras/keras.json, and change the "backend" to "tensorflow"
- ModuleNotFoundError: No module named 'error'
In this case, you need to install keras and tensorflow with conda, which can either be done in the GUI or simply use "conda install keras" and "conda install tensorflow"
-
Neural Net Model installation Guide: Instruction