-
Notifications
You must be signed in to change notification settings - Fork 111
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
Some questions about loading pretrain model and training. #30
Comments
Thanks for your question. Maybe you do not load the pre-trained models correctly. UniFormer/video_classification/slowfast/models/uniformer.py Lines 16 to 26 in e802470
In build.py , it will load the pre-trained model.UniFormer/video_classification/slowfast/models/build.py Lines 42 to 46 in e802470
You can check the log and find whether it outputs: [INFO] build.py: 46: load pretrained model In my codebase, the
And I do not use it to load pre-trained models. I use the code in uniformer.py to load it. It will inflate the 2D kernel smartly.UniFormer/video_classification/slowfast/models/uniformer.py Lines 387 to 421 in e802470
|
Thanks for your quick response. I think I did load the pretrain model, however, there's several warnings and I am not sure if it's matter.
|
There's another error I forgot to mention: the training is always interrupted with:
|
NaN is normal for training Transformer. There are some ways to handle this problem:
|
Moreover, you may use data augmentation for CNN to train UniFormer? But for a large dataset, I suggest you use UniFormer and adopt the same training config as I used for Kinetics. |
Maybe you can set |
Thanks for your detailed response. Your advice about training really helps me a lot. |
Dear author:
I want to fine-tune your model on my dataset of video classification task using provided UniFormer-B model. However, I met some problems.
When I start training, the top1 error is always 100
I have successfully fine-tune my dataset using code facebook SlowFast with different models before.
Before I training UniFormer, I have:
Have I possibly made any mistakes?
Besides that, I notice that SlowFast code using slowfast/utils/checkpoint.py to load pretrain model, while the Uniformer code add a new function in slowfast/model/uniformer.py and copy the origin slowfast/utils/checkpoint.py to slowfast/utils/checkpoint_amp.py. What is the difference between loading pretrain model from the these two functions?
您好:
我想用UniFormer模型在我的数据集上fine-tune,我的任务是video classification,用的是文档中提供的UniFormer-B model,但是遇到了一些问题。
我训练的时候,top-1 error一直是100,如上图。
我之前用facebook SlowFast 的code在不同的模型上面都可以成功训练。训Uniformer的时候,我把我之前project的dataset文件夹直接覆盖了过来,然后关掉了AUG和MIXUP。不知道是哪里出了问题?
此外,SlowFast的code是在slowfast/utils/checkpoint.py 里面读的预训练模型,但我看您的code是在 slowfast/model/uniformer.py 重新实现了一个函数来读,并且把原来的slowfast/utils/checkpoint.py重命名为slowfast/utils/checkpoint_amp.py(但我好像没看到两者之间的差别)。我想了解一下用uniformer.py和checkpoint_amp.py加载预训练模型有区别吗?
The text was updated successfully, but these errors were encountered: