Giter Club home page Giter Club logo

Comments (3)

kozistr avatar kozistr commented on May 31, 2024 1

버그 고친 버전 v2.6.1 배포했습니다! 요 이슈는 닫아볼게요!

감사합니다!

from pytorch_optimizer.

kozistr avatar kozistr commented on May 31, 2024

제보 감사합니다! 아마 exp_avg_sq_row, exp_avg_sq_coltorch.zeros로 만들때 device를 지정하지 않아서 말씀하신 문제가 발생한 거 같네요. 바로 고쳐보겠슴다

from pytorch_optimizer.

kozistr avatar kozistr commented on May 31, 2024

덕분에 Adafactor optimizer 구현 문제를 하나 더 발견해서 같이 고쳐봤습니다. + GPU 에서 테스트 완료 했습니다!

example code

from timm import create_model
from tqdm import tqdm

import torch
from torch.nn import functional as F

from pytorch_optimizer import load_optimizer

bs = 16
backbone = 'resmlp_12_distilled_224'

model = create_model(backbone, pretrained=False, num_classes=1)
model.train()
model.cuda()

optimizer = load_optimizer('adafactor')(model.parameters(), warmup_init=True, weight_decay=1e-3)

inp = torch.randn((bs, 3, 224, 224), dtype=torch.float32)
y = torch.randn((bs, 1), dtype=torch.float32)

inp = inp.cuda()
y = y.cuda()

for _ in tqdm(range(50)):
    optimizer.zero_grad()

    F.binary_cross_entropy_with_logits(model(inp), y).backward()

    optimizer.step()

from pytorch_optimizer.

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.