Skip to content
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

Move to KerasV3 #2

Merged
merged 101 commits into from
Mar 23, 2024
Merged

Move to KerasV3 #2

merged 101 commits into from
Mar 23, 2024

Conversation

innat
Copy link
Owner

@innat innat commented Nov 23, 2023

fix #1

Python 3.9.17 (main, Aug  4 2023, 18:43:44)
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import  os
>>> import torch
>>> os.environ["KERAS_BACKEND"] = "torch"
>>> from videoswin import VideoSwinT
>>> model = VideoSwinT(num_classes=400)
>>> _ = model(torch.ones((1, 32, 224, 224, 3)))
>>> model.load_weights('../VideoSwinT_K400_IN1K_P244_W877_32x224.weights.h5')
>>> model.summary()
Model: "swin_transformer3d"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Layer (type)                       ┃ Output ShapeParam # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ PatchEmbed3D (PatchEmbed3D)        │ ?                             │       9,504 │
├────────────────────────────────────┼───────────────────────────────┼─────────────┤
│ pos_drop (Dropout)                 │ ?                             │           0 │
├────────────────────────────────────┼───────────────────────────────┼─────────────┤
│ BasicLayer1 (BasicLayer)           │ ?                             │     313,386 │
├────────────────────────────────────┼───────────────────────────────┼─────────────┤
│ BasicLayer2 (BasicLayer)           │ ?                             │   1,216,596 │
├────────────────────────────────────┼───────────────────────────────┼─────────────┤
│ BasicLayer3 (BasicLayer)           │ ?                             │  12,012,024 │
├────────────────────────────────────┼───────────────────────────────┼─────────────┤
│ BasicLayer4 (BasicLayer)           │ ?                             │  14,297,424 │
├────────────────────────────────────┼───────────────────────────────┼─────────────┤
│ norm (LayerNormalization)          │ ?                             │       1,536 │
├────────────────────────────────────┼───────────────────────────────┼─────────────┤
│ global_average_pooling3d           │ ?                             │           0 │
│ (GlobalAveragePooling3D)           │                               │             │
├────────────────────────────────────┼───────────────────────────────┼─────────────┤
│ head (Dense)                       │ ?                             │     307,600 │
└────────────────────────────────────┴───────────────────────────────┴─────────────┘
 Total params: 28,158,070 (107.41 MB)
 Trainable params: 28,158,070 (107.41 MB)
 Non-trainable params: 0 (0.00 B)

@innat innat self-assigned this Dec 1, 2023
@innat innat added the enhancement New feature or request label Dec 1, 2023
@innat innat merged commit 0953651 into main Mar 23, 2024
3 checks passed
@innat innat deleted the feat_kerasv3 branch March 23, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Keras V3
1 participant