Should I install the standalone keras or tensorflow.keras? - tensorflow

As commented here https://github.com/keras-team/keras/releases/tag/2.4.0, the keras 2.4.0 is now focused on the Tensorflow implementation and distributed as tensorflow.keras. There is now only one Keras: tensorflow.keras. The Keras documentation also mention that to start using Keras simply installs TensorFlow 2. It seems there is no need to install keras as a separate package.
I note after installing tensorflow, the associated keras version (for tensorflow 2.4.1 as of now) is still 2.4.0, while the pypi.org shows the latest keras version is 2.4.3 (https://pypi.org/project/keras/). The standalone keras and tensorflow.keras are not the same version. I am a little confused which keras version to use to better take advantage of deep learning. Is it better practice to have both?

Do not install both versions of keras. This will cause import and path problems. It is recommended that you use the keras included with tensorflow (tf.keras) because that ensures compatibility between tensorflow and keras. Otherwise some tensorflow API changes may cause errors with keras.

Related

What happens when using higher version tf serving to serve a model from lower version tensorflow?

I have trained and exported a model with tensorflow 1.12.
Then I tested tf-serving 2.1.0、1.15.0、1.12.0 separately to serve the saved_model.
Then I got right results with tf-serving 1.12.0
the results of tf-serving 2.1.0 and 1.15.0 are the same but wrong.
I made another test, use tf-serving 2.1.0 and 1.15.0 separately to serve a model trained by tensorflow 1.15. This time the two results are the same right. It seems tf-serving 2.1.0 and 1.15.0 could make the same results.
Isn't tf serving backward compatible?
I haven't got any warning or error throughout these experiments.

Can I use TensorFlow GPU version without cuDNN, and how?

I am using TensorFlow1.13 GPU version (with cuda), and I do not want to use cuDNN to do the convolution due to some reasons. Anyone know how to do that plz?
You can't use tensorflow GPU without CUDA because Keras is based on it. Tensorflow packs another library inside it that is called Keras which uses this dependency.

Keras 2.2.4 with TensorFlow 1.4.1 crashing GPU instances

What is the minimum TensorFlow version requirement for Keras version 2.2.4?
I'm having trouble when using a Conv2D architecture, the GPU instance seems to crash, i.e. i can see the GPU memory fill up for a small bit and then the running processes just 'crash'.There is no error, the notebook just 'freezes'. Training dense models for example work fine. This exact same notebook with the Conv2D architecture works fine on my laptop with TensorFlow 1.12.0 & Keras 2.2.4.
I'm expecting that this has something to do with the used Keras & TensorFlow version. The GPU used is a Tesla M10 (that only supports CUDA 8.0?). The server with this M10 has Tensorflow version 1.4.1 and Keras 2.2.4.
Any insights into solving this problem would be really appreciated.
Version compatibility between keras and tensorflow is a problem that probably anyone has faced.
As in my answer here, one combination you could use is tensorflow-gpu 1.4 and keras 2.0.8 . You can also check here for more combinations too.
If you need to use keras 2.2.4 you will have to install tensorflow-gpu 1.11 and later, which needs cuda 9.
Keras - Tensorflow version's compatibility is problem that developers have faced many times.
Just check Tensorflow and Keras compatibility:
Check this link for more info

Does inception_v3 use dilations?

I'd like to ask whether the inception_v3 model uses dilations as I am planning to run my model for inference on a server but this server only has tensorflow version 1.3 installed. This version isn't compatible with said dilations so I'd like to make sure my model would work on the server.
No inception_v3 does not use dilations and is compatible with TF 1.3 and up however Mobilenet requires TF 1.5 and up.

Do I need to install keras 2.0 seprately after installing tensorflow 1.3?

I just upgraded my tf from 1.0 to tf 1.3 (pip install --upgrade tensorflow) . I know keras 2.0 became part of tensorflow since tf version 1.2. However, when I import keras and check its version it still shows 1.2. Am I supposed to upgrade keras also? if so, then what does "the Keras API will now become available directly as part of TensorFlow, starting with TensorFlow 1.2" mean?
Nope, you don't need to install keras 2.0 separately. (See: https://www.tensorflow.org/guide/keras)
Do this:
import tensorflow as tf
model = tf.keras.Sequential()
Don't do this (Unless you really need framework independent code):
import keras
model = keras.Sequential()