无法pickle <function Layer.add_loss.<locals>._tag_callable at 0x7fd4045f55e0>:

car*_*i01 6 keras tensorflow

完整错误:

无法pickle <function Layer.add_loss.._tag_callable at 0x7fd4045f55e0>:找不到tensorflow.python.keras.engine.base_layer.Layer.add_loss.._tag_callable

我正在尝试使用为tensorflow 1编写的代码来训练这个神经网络,但我无法使用tensorflow 2用我的虚拟环境来pickle模型。有谁知道我哪里出错了?谢谢!