Closed Arlan2191 closed 4 years ago
I have fixed the issue, I simply changed the string 'scale' to 'scale_', as shown below. And did the same in colab and had to downgrade tensorflow=2.3.0 to tensorflow=2.2.0, and now it's working.
x = Lambda(lambda inputs, scale_: inputs[0] + inputs[1] * scale_,
output_shape=K.int_shape(x)[1:],
arguments={'scale_': scale_},
name=block_name)([x, up])
I tried to use the function SEInceptionResNetV2() within model.py as shown below, and the import was successful but when called raises a Type Error:() got an unexpected keyword argument 'scale' . The error traced the problem to be caused by this particular Lambda function call within the inception_resnet_block(), as shown below.
I then hypothesized maybe its related to my local installation of tensorflow being 2.2.0, so I proceeded to run model.py within Google Colab, which has tensorflow version == 2.3.0. But then I encountered a different error, it is still a Type Error but with details: 'NoneType' object is not subscriptable, as shown below.
Inside model.py local Machine
Error encountered in local:
Within inception_resnet_block that caused the error:
Inside model.py in Google Colab:
Error encountered in Colab:
And I want to point out that this is the only model that raised an error, the other models worked for both 2.3.0 and 2.2.0 versions of tensorflow.