From 8567d8a82879f1ec6225f3f000702073fb07c4ce Mon Sep 17 00:00:00 2001 From: Zach <20629897+craymichael@users.noreply.github.com> Date: Fri, 4 Dec 2020 19:43:17 +0000 Subject: [PATCH] Fix invalid access of Keras backend --- prednet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prednet.py b/prednet.py index b5a0208..ab1f2b6 100755 --- a/prednet.py +++ b/prednet.py @@ -165,7 +165,7 @@ def get_initial_state(self, x): initial_state = K.reshape(initial_state, output_shp) initial_states += [initial_state] - if K._BACKEND == 'theano': + if K.backend() == 'theano': from theano import tensor as T # There is a known issue in the Theano scan op when dealing with inputs whose shape is 1 along a dimension. # In our case, this is a problem when training on grayscale images, and the below line fixes it.