Comments (5)
@Mrbishuai 抱歉回复晚了
我不清楚是否在使用过程中的参数赋值出现了问题,从代码上讲,如果--neg
的赋值不同,对应到训练部分的代码train_ssl.py和intra-neg的生成部分gen_neg.py,输入的样本肯定是不一样的。
因为固定了随机数种子,所以对于相同实验环境,如果参数一致结果应该是一致的。
由于best model都是best_model_141.pt,所以我觉得很有可能两次实验的各项参数都相同。
因此对于自监督部分的训练部分,可能还需要你那边再确认一下。
更详细的调试可以去看两个模型的同一个iteration的输入,或者是你已经训练好的两次模型的best_model_141.pt的参数是否一致。
对于finetune的结果来讲,73.5算是比较正常的数值。
from iic.
感谢您百忙之中对我的回复,我对代码又进行了训练,发现了一个问题不是很明白。当直接运行python ft_classify.py --ckpt=/path/to/your/model --dataset=ucf101 --mode=test测试时必须修改ft.classify.py
if args.mode == 'train':
model.load_state_dict(pretrained_weights['model'], strict=False)
else:
#model.load_state_dict(pretrained_weights['model'], strict=True)
model.load_state_dict(pretrained_weights, strict=True)
改为:
if args.mode == 'train':
model.load_state_dict(pretrained_weights['model'], strict=False)
else:
#model.load_state_dict(pretrained_weights['model'], strict=True)
model.load_state_dict(pretrained_weights['model'], strict=True)
我想知道是不是会对结果产生影响呢?
from iic.
这部分主要看用的是什么模型,model.load_state_dict()
只是用来load模型权重的变量。
strict=True
主要是在测试时使用,一方面也检查模型是否参数正确,因为在finetine的时候最后的分类层是新的,如果在finetune时设置strict=True
检查,那么只会显示fc层load有问题,这样的话fc层就是新的,可以放心设置成False进行finetune。
至于第一个参数,主要就是解析好的模型的参数。有些代码可能直接就是torch.load(checkpoint)
。这部分的话当时是怎么存储就怎么load,比如是以dict形式,那么就要加上类似pretrained_weights['model']
。如果是参数名有变化,则可以加一个函数过滤一下。
在我这边的代码里,如果两个都可以的话,应该是没有区别的。我看了一下我的finetune.py部分和前面train_ssl.py部分其实模型存储的时候都是以dict的形式。finetune部分因为dict只有一个key,所以应该这么写也正确load了,当时写的时候没怎么注意。
from iic.
谢谢您在百忙之中给我回复,最近我发现您的又一篇文章,再次基础上进行的大幅的提升,Self-Supervised Video Representation Using Pretext-Contrastive Learning不知道您是否愿意在方便的时候将代码发给我,以供学习。我的邮箱[email protected],谢谢您!
from iic.
@Mrbishuai 完整版本包含较多的组合,比较忙没怎么整理,一个可用的toy版本在我的这个repo里。
from iic.
Related Issues (13)
- pretrained SSL weights HOT 2
- Have the same accuracy HOT 6
- Question about pretraining HOT 1
- pytorch 1.7+
- UCF101 action classification result only at 0.68 HOT 6
- 方法泛化 HOT 1
- Runtime Error while running the training script HOT 1
- Backbone not freezed during training of classifier HOT 2
- Training Loss Not Improving HOT 1
- loss stuck in multi-gpu HOT 3
- Training on hmdb51 HOT 8
- Poor finetuning results HOT 23
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 iic.