Keras`model.fit`期间发生运行时错误“ AttributeError:'tuple'对象没有属性'_keras_mask'”

I start my own image encoder basing on the example from this "Manipulate complex graph topologies" (leveraging 2 separate inputs for model). Tensorflow version is 2.2.0

模型编译成功(请参见最后的摘要)。

我的输入数据如下所示:

train_top_reduce, train_left_reduce = ( <list of numpy - 2d matrix>, <list of numpy - 2d matrix>)
train_x = {"top_reduce":train_top_reduce, "left_reduce":train_left_reduce}
train_y = <list of numpy.asarray( PIL's image ) >

当我尝试:

history = model.fit(train_x, train_y)

我有一个例外:

AttributeError:“元组”对象没有属性“ _keras_mask”      c:\ python \ python37 \ lib \ site-packages \ tensorflow \ python \ keras \ engine \ training.py:571 train_function *           输出= self.distribute_strategy.run(      c:\ python \ python37 \ lib \ site-packages \ tensorflow \ python \ distribute \ distribute_lib.py:951运行**       返回self._extended.call_for_each_replica(fn,args = args,kwargs = kwargs)      c:\ python \ python37 \ lib \ site-packages \ tensorflow \ python \ distribute \ distribute_lib.py:2290 call_for_each_replica       返回self._call_for_each_replica(fn,args,kwargs)      c:\ python \ python37 \ lib \ site-packages \ tensorflow \ python \ distribute \ distribute_lib.py:2649   _call_for_each_replica       返回fn(* args,** kwargs)      c:\ python \ python37 \ lib \ site-packages \ tensorflow \ python \ keras \ engine \ training.py:531 train_step **       y_pred =自我(x,训练=真实)      c:\ python \ python37 \ lib \ site-packages \ tensorflow \ python \ keras \ engine \ base_layer.py:927调用       输出= call_fn(cast_inputs,* args,** kwargs)      c:\ python \ python37 \ lib \ site-packages \ tensorflow \ python \ keras \ engine \ network.py:719呼叫       convert_kwargs_to_constants = base_layer_utils.call_context()。保存)      c:\ python \ python37 \ lib \ site-packages \ tensorflow \ python \ keras \ engine \ network.py:832 _run_internal_graph       input_t._keras_mask =遮罩

型号摘要:

图层(类型)输出形状参数#连接到

top_reduce(InputLayer)[(无,无,256,5 0

left_reduce(InputLayer)[(无,无,256、5 0

top_dence(密集)(无,无,256、32 1632 top_reduce [0] [0]

left_dence(密集)(无,无,256、32 1632 left_reduce [0] [0]

串联(串联)(无,无,256、64 0 top_dence [0] [0]                                                                  left_dence [0] [0]

conv2d(Conv2D)(无,无,256、32 2080并置[0] [0]

评论