简体   繁体   中英

compatible Keras and Tensorflow version

I have a separated training and inference system. The inference system has tensorflow version 1.8 (yes, I know, it is old, but I have no say on upgrading the system...).

I am building my model in Keras, then try to convert it to pb model for inferencing. I have trouble finding the compatible Keras version could work with tensorflow 1.8. I am wondering what's the Keras version for tensorflow 1.8? Thanks!

One of my environment has tensorflow==1.8.0 I have checked with print(keras.__version__) and it returns 2.1.5-tf my whole code was:

from tensorflow.python import keras
print(keras.__version__)

2.1.5-tf

For me, keras 2.1.6 with Python 3.6 worked for Tensorflow 1.8. Here is the link where I found the version of Keras from.

You can, and probably should use the Keras that is in your tensorflow version.

Here is the code:

import tensorflow as tf
from tensorflow.python import keras
from tensorflow.python.keras import backend as K

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM