Skip to content

Commit 49e2097

Browse files
committed
Add tfhub finetuning tutorial.
Will upload these tfhub models to official tfhub soon.
1 parent 42ad3a4 commit 49e2097

File tree

3 files changed

+660
-3
lines changed

3 files changed

+660
-3
lines changed

efficientnetv2/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# EfficientNetV2
22

3-
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.sandbox.google.com/github/google/automl/blob/master/efficientnetv2/tutorial.ipynb)
4-
[![Paper](http://img.shields.io/badge/Paper-arXiv.2104.00298-B3181B?logo=arXiv)](https://arxiv.org/abs/2104.00298)
3+
[Paper![Paper](http://img.shields.io/badge/Paper-arXiv.2104.00298-B3181B?logo=arXiv)](https://arxiv.org/abs/2104.00298)
4+
[Tutorial![Tutorial In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.sandbox.google.com/github/google/automl/blob/master/efficientnetv2/tutorial.ipynb)
5+
[TF-hub![TF-Hub In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.sandbox.google.com/github/google/automl/blob/master/efficientnetv2/tfhub.ipynb)
56

67

78
- May13/2021: Initial code release for [EfficientNetV2 models](https://arxiv.org/abs/2104.00298): accepted to ICML'21.

efficientnetv2/effnetv2_model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,14 @@ def summary(self, input_shape=(224, 224, 3), **kargs):
579579
model = tf.keras.Model(inputs=[x], outputs=self.call(x, training=True))
580580
return model.summary()
581581

582-
def call(self, inputs, training, features_only=None):
582+
def call(self, inputs, training, features_only=None, single_out=None):
583583
"""Implementation of call().
584584
585585
Args:
586586
inputs: input tensors.
587587
training: boolean, whether the model is constructed for training.
588588
features_only: build the base feature network only.
589+
single_out: If true, only return the single output.
589590
590591
Returns:
591592
output tensors.
@@ -628,6 +629,9 @@ def call(self, inputs, training, features_only=None):
628629
outputs = self._head(outputs, training)
629630
self.endpoints.update(self._head.endpoints)
630631

632+
if single_out: # Use for building sequential models.
633+
return outputs
634+
631635
return [outputs] + list(
632636
filter(lambda endpoint: endpoint is not None, [
633637
self.endpoints.get('reduction_1'),

efficientnetv2/tfhub.ipynb

Lines changed: 652 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)