Tensorflow ResNet的TypeError:(';关键字参数未理解:';,';输入';)

Tensorflow ResNet的TypeError:(';关键字参数未理解:';,';输入';),tensorflow,keras,tensorflow2.0,tf.keras,resnet,Tensorflow,Keras,Tensorflow2.0,Tf.keras,Resnet,此代码: input\u tensor=input(形状=(input\u宽度,input\u高度,3)) ResNet50=ResNet50(包括top=False、weights=imagenet、input\u tensor=input\u tensor) top_模型=顺序() top\u model.add(展平(input\u shape=ResNet50.output\u shape[1:])) top_model.add(密集型(8,activation='softmax'))

此代码:

input\u tensor=input(形状=(input\u宽度,input\u高度,3))
ResNet50=ResNet50(包括top=False、weights=imagenet、input\u tensor=input\u tensor)
top_模型=顺序()
top\u model.add(展平(input\u shape=ResNet50.output\u shape[1:]))
top_model.add(密集型(8,activation='softmax'))
模型=模型(输入=ResNet50.input,输出=top_模型(ResNet50.output))
model.compile(loss='classifical_crossentropy',
优化器=优化器.SGD(lr=1e-3,动量=0.9),
指标=[‘准确度’])
导致
类型错误

TypeError回溯(最近一次调用)
在()
58 top\u model.add(展平(输入\u shape=ResNet50.output\u shape[1:]))
59顶置型。添加(密集型(8,激活='softmax'))
--->60模型=模型(输入=ResNet50.input,输出=top_模型(ResNet50.output))
61模型编译(loss='classifical_crossentropy',
62优化器=优化器.SGD(lr=1e-3,动量=0.9),
2帧
/验证\u kwargs中的usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/generic\u utils.py(kwargs,allowed\u kwargs,error\u消息)
776对于kwargs中的kwarg:
777如果kwarg不在允许的kwarg内:
-->778 raise TYPE错误(错误消息,kwarg)
779
780
TypeError:('Keyword argument not Understanding:','input')
我该怎么修

  • tensorflow版本:2.3.0
  • keras版本:2.4.3

正如史努比博士在评论中提到的,参数被称为“输入”和带有“s”的“输出”:

model = Model(inputs=inputs, outputs=x)

这些参数称为输入和输出outputs@Dr.Snoopy我没听懂,你什么意思?