【发布时间】:2022-08-09 17:41:22
【问题描述】:
我通过降级 keras 安装了拓扑包(pip install \'keras==2.1.6\' --force-reinstall),因为它在较新的版本中不存在。我仍然收到导入网络错误。
Trying:
from keras.engine.topology import Network
Error:
ImportError: cannot import name \'Network\' from \'keras.engine.topology\' (/usr/local/lib/python3.7/dist-packages/keras/engine/topology.py)
如果 Network 不存在,那么我怎样才能得到它以便其余代码(CycleGAN)可以使用 Network()。任何帮助,将不胜感激。
-
你在说什么代码,为什么需要网络?
-
我在用于水下图像增强的 HybridDetectionGAN 模型中遇到此错误。该模型进一步使用了 CycleGAN 模型。在这段代码中,他们使用了 Network()。下面是示例代码行。来自link 模型。 self.D_A_static = Network(inputs=image_A, outputs=guess_A, name=\'D_A_static_model\') self.D_B_static = Network(inputs=image_B, outputs=guess_B, name=\'D_B_static_model\')
标签: keras tensorflow2.0