Giter Site home page Giter Site logo

Comments (2)

julymiaw avatar julymiaw commented on June 1, 2024

我猜你的设备并不是专业的服务器,但即使是专业的服务器,这一步卡住也是正常的。要知道,这里的Epoch是一整轮训练,一共训练8轮,但是一轮训练可能包含了数据大小除以batch_size步,而这一部分是没有任何反馈的。我估计,一轮训练完成的时间至少为1周,你这才跑了不到2小时,肯定不会有动静的。
我的建议是,像这样修改train函数:

def train(args, train_dataset, model, tokenizer, optimizer):
    """这里省略了一堆代码"""
    # train_iterator = trange(args.start_epoch, int(args.num_train_epochs), desc="Epoch", disable=args.local_rank not in [-1, 0], file=sys.stdout)
    set_seed(args)  # Added here for reproductibility (even between python 2 and 3)
    model.train()
    for idx in range(args.start_epoch, int(args.num_train_epochs)):
        tr_loss = 0.0
        for step, batch in enumerate(tqdm(train_dataloader, desc="Epoch_" + str(args.start_epoch + idx), file=sys.stdout, leave=False)):

至少对我来说,看起来更轻松了,你会看到当前在第几轮的第几步

from codebert.

julymiaw avatar julymiaw commented on June 1, 2024

另外一个问题,进程终止,这个问题我也遇到了,感觉大概率是内存不足导致的

from codebert.

Related Issues (20)

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.