Closed zubairahmed-ai closed 4 years ago
Receiving this error trying to Fine-tune a EfficientNetB0 using Tensorflow 2.0
ValueError: The last dimension of the inputs toDenseshould be defined. FoundNone.
ValueError: The last dimension of the inputs to
should be defined. Found
.
When fine-tuning a EfficientNetB0 with my own fully connected layer I get the above error
my import looks like this import efficientnet.tfkeras as efn
import efficientnet.tfkeras as efn
and
baseModel = efn.EfficientNetB0(weights="imagenet", include_top=False) headModel = FCHeadNet.build(baseModel, len(classNames), 256)
baseModel = efn.EfficientNetB0(weights="imagenet", include_top=False)
headModel = FCHeadNet.build(baseModel, len(classNames), 256)
But the error is shown in this line
headModel = Dense(D, activation="relu")(headModel)
Fixed
How did you fixed it?
Summary
Receiving this error trying to Fine-tune a EfficientNetB0 using Tensorflow 2.0
Environment
Logs or source codes for reproduction
ValueError: The last dimension of the inputs to
Denseshould be defined. Found
None.
When fine-tuning a EfficientNetB0 with my own fully connected layer I get the above error
my import looks like this
import efficientnet.tfkeras as efn
and
baseModel = efn.EfficientNetB0(weights="imagenet", include_top=False)
headModel = FCHeadNet.build(baseModel, len(classNames), 256)
But the error is shown in this line
headModel = Dense(D, activation="relu")(headModel)