如何使用异常架构
How to use exception architecture
我想用xception模型对图像进行分类,但是我得到了valueerror。
xception=keras.applications.xception.Xception(include_top=False,input_shape=(71,71,3))
classifier=Sequential()
for layer in xception.layers:
classifier.add(layer)
我收到这个错误
ValueError: Input 0 is incompatible with layer conv2d_1: expected axis -1 of input shape to have value 64 but got shape (None, 33, 33, 128)
我在使用 resnet.But 时也遇到了这个错误 我在使用 vgg16 或 vgg19.Can 时没有得到它,有人告诉我如何使用它吗??
您可以使用功能API。这是分类器
的一个可能示例
#Base model Xception
xception=keras.applications.xception.Xception(include_top=False,input_shape=(71,71,3))
# Input of your model
input=Input(shape=(71,71,3))
# Add the inception base model to your model
y=xception(input)
.
.
# Other layers by passing previous output
y=Dense(...)(y)
# Define model
model=Model(input,y)
我想用xception模型对图像进行分类,但是我得到了valueerror。
xception=keras.applications.xception.Xception(include_top=False,input_shape=(71,71,3))
classifier=Sequential()
for layer in xception.layers:
classifier.add(layer)
我收到这个错误
ValueError: Input 0 is incompatible with layer conv2d_1: expected axis -1 of input shape to have value 64 but got shape (None, 33, 33, 128)
我在使用 resnet.But 时也遇到了这个错误 我在使用 vgg16 或 vgg19.Can 时没有得到它,有人告诉我如何使用它吗??
您可以使用功能API。这是分类器
的一个可能示例#Base model Xception
xception=keras.applications.xception.Xception(include_top=False,input_shape=(71,71,3))
# Input of your model
input=Input(shape=(71,71,3))
# Add the inception base model to your model
y=xception(input)
.
.
# Other layers by passing previous output
y=Dense(...)(y)
# Define model
model=Model(input,y)