0

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

  • You're incorrectly calling the variables. I'm guessing `input_shape` is not meant to be "400" as that doesn't make much sense. Also, you should add more details to this question. – I M Mar 16 '22 at 02:19

1 Answers1

0

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)

I M
  • 313
  • 1
  • 9