Merge pull request #35 from cneud/upgrade_to_tf2_with_tf1.compat_session

fix tf2 with tf1.compat session
pull/36/head
vahidrezanezhad 3 years ago committed by GitHub
commit 0fe5232488
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,6 @@
numpy >= 1.17.0, < 1.19.0
numpy
setuptools >= 41
opencv-python-headless
ocrd >= 2.22.3
keras >= 2.3.1, < 2.4
h5py < 3
tensorflow-gpu >= 1.15, < 1.16
tensorflow-gpu >= 2.4.0

@ -14,10 +14,11 @@ import cv2
environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
stderr = sys.stderr
sys.stderr = open(devnull, 'w')
from keras.models import load_model
from keras.backend import tensorflow_backend
sys.stderr = stderr
import tensorflow as tf
from tensorflow.keras.models import load_model
from tensorflow.python.keras import backend as tensorflow_backend
sys.stderr = stderr
import logging

Loading…
Cancel
Save