Coder Social home page Coder Social logo

Comments (7)

sdc17 avatar sdc17 commented on June 6, 2024

您好,可以使用自己的数据集在retrain阶段进行微调。也可以在BLIP本来的数据集上search和retrain完,再拿自己的数据集微调。
如果是在BLIP模型上剪枝,使用代码和脚本里提供的对于BLIP剪枝的默认参数即可。
如果时间允许,可以多跑一些retrain的epoch,效果应该会好些。

from upop.

HaoFYu avatar HaoFYu commented on June 6, 2024

非常感谢,另外如果采用单张4090进行压缩,和log中的时间记录相差会有多大

from upop.

sdc17 avatar sdc17 commented on June 6, 2024

单卡与单卡比较速度应该是相近的,但是log中是用多卡训练的。
只用单卡4090的话,相比log可能需要5倍左右或者再多一点的时间。

from upop.

HaoFYu avatar HaoFYu commented on June 6, 2024

您好,谢谢您的解答,对我帮助很大。
完整search后再在retrain中微调的方法对时间要求太大,我能否通过如下代码来加载您剪枝后的checkpoint

model = blip_vqa(client=client, pretrained='', image_size=config['image_size'], 
                            vit=config['vit'], vit_grad_ckpt=config['vit_grad_ckpt'], vit_ckpt_layer=config['vit_ckpt_layer'],
                            evaluate=True)
model.prune_if_compressed(client, config['pretrained'])

并通过如下代码(其中train_loader是我自己的数据集)达到微调的目的

for epoch in range(0, config['max_epoch']):
        if args.distributed:
            train_loader.sampler.set_epoch(epoch)
            
cosine_lr_schedule(optimizer, epoch, config['max_epoch'], config['init_lr'], config['min_lr'])          
train_stats = train(model, train_loader, optimizer, epoch, device, config, scaler=scaler) 

from upop.

sdc17 avatar sdc17 commented on June 6, 2024

可以的,直接load剪枝后的checkpoint就不用search了

from upop.

HaoFYu avatar HaoFYu commented on June 6, 2024

请问amp参数代表什么意义呢?
parser.add_argument('--amp', action='store_true')

from upop.

sdc17 avatar sdc17 commented on June 6, 2024

amp=automatic mixed precision 自动混合精度 readme里有写

from upop.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.