-
Notifications
You must be signed in to change notification settings - Fork 31.6k
TF implementation of RegNets #17554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
TF implementation of RegNets #17554
Changes from 28 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
99641bd
chore: initial commit
ariG23498 7ea1d01
chore: porting the rest of the modules to tensorflow
ariG23498 74cd9a0
Fix initilizations (#1)
sayakpaul 1b42157
chore: styling nits.
sayakpaul f1bf27a
fix: cross-loading bn params.
sayakpaul adec9db
fix: regnet tf model, integration passing.
sayakpaul e90fdfc
add: tests for TF regnet.
sayakpaul ec9bf1c
fix: code quality related issues.
sayakpaul 419da37
chore: added rest of the files.
sayakpaul 213e9e9
Merge pull request #2 from ariG23498/feat/tf-regnets
ariG23498 cf3d797
minor additions..
sayakpaul b9aa7b5
fix: repo consistency.
sayakpaul b93abe8
fix: regnet tf tests.
sayakpaul c4cd6db
chore: reorganize dummy_tf_objects for regnet.
sayakpaul 7c58838
chore: remove checkpoint var.
sayakpaul ab7f80e
chore: remov unnecessary files.
sayakpaul 5bf7d28
chore: run make style.
sayakpaul 9e26607
Merge branch 'main' into aritra-regnets
ariG23498 23a20ad
Update docs/source/en/model_doc/regnet.mdx
sayakpaul 6fdcc6d
chore: PR feedback I.
sayakpaul 736b521
fix: pt test. thanks to @ydshieh.
sayakpaul 55a8a0f
New adaptive pooler (#3)
sayakpaul 882959e
Empty-Commit
sayakpaul 221c76d
chore: remove image_size comment.
sayakpaul 5c285e4
chore: remove playground_tf.py
sayakpaul eafaeb9
chore: minor changes related to spacing.
sayakpaul 0ce07cd
Merge branch 'main' into aritra-regnets
ariG23498 cc2c1fe
chore: make style.
sayakpaul c416b59
Update src/transformers/models/regnet/modeling_tf_regnet.py
sayakpaul 579fd86
Update src/transformers/models/regnet/modeling_tf_regnet.py
sayakpaul 040032f
chore: refactored __init__.
sayakpaul ab641fe
chore: copied from -> taken from./g
sayakpaul 222493c
Merge branch 'main' into aritra-regnets
ariG23498 478b352
adaptive pool -> global avg pool, channel check.
sayakpaul d292694
chore: move channel check to stem.
sayakpaul 9e07109
pr comments - minor refactor and add regnets to doc tests.
sayakpaul 969762f
Update src/transformers/models/regnet/modeling_tf_regnet.py
sayakpaul 0fa00bc
minor fix in the xlayer.
sayakpaul fd053e8
Merge branch 'main' into aritra-regnets
ariG23498 a893f3e
Empty-Commit
sayakpaul 0360f45
chore: removed from_pt=True.
sayakpaul d7d395a
Merge branch 'main' into aritra-regnets
ariG23498 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,7 @@ | |
| from typing import TYPE_CHECKING | ||
|
|
||
| # rely on isort to merge the imports | ||
| from ...file_utils import _LazyModule, is_torch_available | ||
| from ...utils import OptionalDependencyNotAvailable | ||
| from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available | ||
|
|
||
|
|
||
| _import_structure = {"configuration_regnet": ["REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "RegNetConfig"]} | ||
|
|
@@ -37,6 +36,14 @@ | |
| "RegNetPreTrainedModel", | ||
| ] | ||
|
|
||
| if is_tf_available(): | ||
| _import_structure["modeling_tf_regnet"] = [ | ||
| "TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST", | ||
| "TFRegNetForImageClassification", | ||
| "TFRegNetModel", | ||
| "TFRegNetPreTrainedModel", | ||
| ] | ||
|
|
||
|
|
||
| if TYPE_CHECKING: | ||
| from .configuration_regnet import REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP, RegNetConfig | ||
|
|
@@ -54,6 +61,14 @@ | |
| RegNetPreTrainedModel, | ||
| ) | ||
|
|
||
| if is_tf_available(): | ||
|
||
| from .modeling_tf_regnet import ( | ||
| TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, | ||
| TFRegNetForImageClassification, | ||
| TFRegNetModel, | ||
| TFRegNetPreTrainedModel, | ||
| ) | ||
|
|
||
|
|
||
| else: | ||
| import sys | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in a try/except block (e.g. ViT's init)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!