'I want to ask about this error sbouy input shape, i'm making a thesis about image classification using efficientnet

conv_base = EfficientNetB6(weights="imagenet", include_top=False, input_shape=400,400)

SyntaxError: positional argument follows keyword argument

#Options: EfficientNetB0, EfficientNetB1, EfficientNetB2, EfficientNetB3, ... up to 7 #Higher the number, the more complex the model is. and the larger resolutions it can handle, but the more GPU memory it will need# loading pretrained conv base model #input_shape is (height, width, number of channels) for images

conv_base = EfficientNetB6(weights="imagenet", include_top=False, input_shape=input_shape)

#this is the original code that i found, but i don't know what to put



Solution 1:[1]

Firstly, the error you're describing isn't related to EfficientNet or TensorFlow, it's a syntax error. You cannot call positional arguments after keyword arguments. For example:

def foo(x, y):
    return x

foo(1, 2) # two positional arguments
foo(x=1, y=2) # two keyword arguments 
foo(1, y=2) # a positional argument followed by a keyword
# foo(x=1, 2) # Syntax error. A keyword argument followed by a positional one

Secondly, from reading the documentation you can clearly see:

input_shape: Optional shape tuple, only to be specified if include_top is False. It should have exactly 3 inputs channels.

You're passing on "400", which is not a tuple and doesn't have 3 input channels.

Your input_shape should look something like (height, width, number of channels) - for example (400, 400, 3)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 I M