diff --git a/deep_learning4e.py b/deep_learning4e.py index 9f5b0a8f7..bb29306da 100644 --- a/deep_learning4e.py +++ b/deep_learning4e.py @@ -4,7 +4,8 @@ import statistics import numpy as np -from keras import Sequential, optimizers +from tensorflow import keras +from tensorflow.keras import Sequential, optimizers from keras.layers import Embedding, SimpleRNN, Dense from keras.preprocessing import sequence diff --git a/perception4e.py b/perception4e.py index edd556607..bc39c0ece 100644 --- a/perception4e.py +++ b/perception4e.py @@ -1,7 +1,7 @@ """Perception (Chapter 24)""" import cv2 -import keras +from tensorflow import keras import matplotlib.pyplot as plt import numpy as np import scipy.signal diff --git a/requirements.txt b/requirements.txt index dd6b1be8a..87d90dec1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,4 +15,4 @@ pytest-cov qpsolvers scipy sortedcontainers -tensorflow \ No newline at end of file +tensorflow>=2.6.0 diff --git a/tests/test_deep_learning4e.py b/tests/test_deep_learning4e.py index 34676b02b..9264c39f0 100644 --- a/tests/test_deep_learning4e.py +++ b/tests/test_deep_learning4e.py @@ -1,4 +1,5 @@ import pytest +from tensorflow import keras from keras.datasets import imdb from deep_learning4e import *