PyCharm 报错: ValueError: The name 'activation' is used 2 times in the model. 解决方法
在使用 Keras 构建神经网络时,如果出现错误“ValueError: The name 'activation' is used 2 times in the model.”,这是因为在模型中使用了相同的层名称 'activation'。
为了解决这个问题,需要将其中一个 'activation' 改名为一个唯一的名称。例如,可以将第一行代码修改为:
x = Activation('relu', name='relu_activation')(x)
这样,就可以避免出现重复的层名称,从而解决错误。
原文地址: https://www.cveoy.top/t/topic/no8B 著作权归作者所有。请勿转载和采集!