Comments (4)
Thank you for the answer!
After following @realgump 's suggestion, I could load the ViViT parameters normally.
For those who want to know the detailed instructions, I did the following steps.
- import ViViT model from original repo
from video transformer import ViViT
- set weights_from param to 'kinetics' when initializing ViViT model
pretrain_pth = './vivit_model.pth'
num_frames = num_frames * 2
frame_interval = frame_interval // 2
model = ViViT(num_frames=num_frames,
img_size=224,
patch_size=16,
embed_dims=768,
in_channels=3,
attention_type='fact_encoder',
return_cls_token=True,
weights_from='kinetics',
pretrain_pth=pretrain_pth)
- remove the remaining initialization code
# comment out init_from_pretrain_() method
cls_head = ClassificationHead(num_classes=num_class, in_channels=768)
# msg_trans = init_from_pretrain_(model, pretrain_pth, init_module='transformer')
msg_cls = init_from_pretrain_(cls_head, pretrain_pth, init_module='cls_head')
Thanks again for the quick response!
from videotransformer-pytorch.
Have you set weights_from? I have met the same error and fixed it after set weights_from.
from videotransformer-pytorch.
@Simcs Sorry for that, it should be the reason as @realgump said where we have updated the weights initialization function. But we have not keep path with it in notebook.
from videotransformer-pytorch.
我想问问您成功加载vivit-b预训练权重了吗?
from videotransformer-pytorch.
Related Issues (20)
- How do we load ImageNet-21k ViT weights? HOT 3
- Vivit Training Problem HOT 1
- What is the final score of maskfeat? HOT 6
- torch version HOT 1
- How to load Tensorflow checkpoints? HOT 3
- How to dataloader? HOT 2
- structure of ViViT-b HOT 1
- Errors when loading pretrained weights -pretrain_pth 'vivit_model.pth' -weights_from 'kinetics' HOT 1
- Question about Loading a pretrained model(ViT)
- Log-File for ViViT finetuning with Imagenet pre-train Weights
- How to convert TimeSformer Implementation For Regression Tasks
- While training viti I am getting thsi error
- 代码写的真好
- regarding fine-tuning ViViT model on my dataset.
- How can ViViT be used to extract video features?
- How Can I Create a Video_Loader Function That Lets Me Use My Own Videos With ViViT?
- where is vit-b pretrained model on imagenet-21k?
- How to test my trained model?
- how to make datasets use my own videos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from videotransformer-pytorch.