Trouble when I want to fit the model

Hi Everyone

Right now, I’m building the GRU model in Julia by using PyCall with Keras Package from Python. When I want to fit the model then I got the problem issue.

this is my code

# The GRU architecture
model_GRU = tf.keras.Sequential()
# First GRU layer with Dropout regularisation
model_GRU.add(tf.keras.layers.Dropout(0))
model_GRU.add(tf.keras.layers.GRU(units=38, return_sequences="True", input_shape=(size(X_train)[2],1), activation="tanh"))
model_GRU.add(tf.keras.layers.Dropout(0.25))
# Second GRU layer
model_GRU.add(tf.keras.layers.GRU(units=38, return_sequences="True", input_shape=(size(X_train)[2],1), activation="tanh"))
model_GRU.add(tf.keras.layers.Dropout(0.25))
# Third GRU layer
model_GRU.add(tf.keras.layers.GRU(units=38, return_sequences="True", input_shape=(size(X_train)[2],1), activation="tanh"))
model_GRU.add(tf.keras.layers.Dropout(0.25))
# Fourth GRU layer
model_GRU.add(GRU(units=38, return_sequences=True, input_shape=(X_train.shape[1],1), activation='tanh'))
model_GRU.add(Dropout(0.25))
# Five GRU layer
model_GRU.add(tf.keras.layers.GRU(units=38, activation="sigmoid"))
model_GRU.add(tf.keras.layers.Dropout(0.25))
# The output layer
model_GRU.add(tf.keras.layers.Dense(units=1))

# Compiling the RNN
model_GRU.compile(optimizer=ko.Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999, epsilon=1e-07, amsgrad="False", name="Adam"), loss="mean_squared_error", metrics=["mse","mae"])

Y_train = reshape(Y_train,(size(Y_train)[1],1))
# Fitting to the training set
model_GRU.fit(X_train, Y_train, epochs=2000, batch_size=150, verbose=1)

and I got the Error like this

PyError ($(Expr(:escape, :(ccall(#= C:\Users\User\.julia\packages\PyCall\BD546\src\pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>
TypeError("'NoneType' object is not callable")
  File "C:\Users\User\.julia\conda\3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 108, in _method_wrapper
    return method(self, *args, **kwargs)
  File "C:\Users\User\.julia\conda\3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1098, in fit
    tmp_logs = train_function(iterator)
  File "C:\Users\User\.julia\conda\3\lib\site-packages\tensorflow\python\eager\def_function.py", line 780, in __call__
    result = self._call(*args, **kwds)
  File "C:\Users\User\.julia\conda\3\lib\site-packages\tensorflow\python\eager\def_function.py", line 807, in _call
    return self._stateless_fn(*args, **kwds)  # pylint: disable=not-callable
in eval at base\boot.jl:360 
in top-level scope at GRU_model.jl:173
in  at PyCall\BD546\src\pyfncall.jl:86
in var"#_#114" at PyCall\BD546\src\pyfncall.jl:86
in _pycall! at PyCall\BD546\src\pyfncall.jl:11
in _pycall! at PyCall\BD546\src\pyfncall.jl:29
in __pycall! at PyCall\BD546\src\pyfncall.jl:42 
in disable_sigint at base\c.jl:458 
in #107 at PyCall\BD546\src\pyfncall.jl:43 
in macro expansion at PyCall\BD546\src\exception.jl:97 
in _handle_error at PyCall\BD546\src\exception.jl:83
in pyerr_check at PyCall\BD546\src\exception.jl:66 
in pyerr_check at PyCall\BD546\src\exception.jl:62

Can someone help me to solve this? Thank you