1. WandB 회원가입하기
Weights & Biases – Developer tools for ML
WandB is a central dashboard to keep track of your hyperparameters, system metrics, and predictions so you can compare models live, and share your findings.
wandb.ai
2. API keys 복사
오른쪽상단 프로필 → Settings → Danger Zone 에 있는 API keys를 복사
3. Secrets 입력하기
kaggle notebook 상단 Add-ons → Secrets
Label에 wandb 쓰고, Value에 복사한 API keys 붙여넣고 Save를 누른다.
※ 위 이미지처럼 이미 되어있는 경우는 Attach to Notebook 체크하고 Done을 누른다. ※
4. notebook에 코드 추가
import wandb
#Secrets에 있는 Code Snippet 복사해서 붙여넣기
from kaggle_secrets import UserSecretsClient
user_secrets = UserSecretsClient()
secret_value = user_secrets.get_secret("wandb")
os.environ["WANDB_API_KEY"] = secret_value
wandb.login()
wandb.init(project='프로젝트 이름', entity = '사용자 이름', name='이름(해당 버전)',
config={"learning_rate": CFG['LEARNING_RATE'],
"epochs": CFG['EPOCHS'],
"batch_size": CFG['BATCH_SIZE']
})
log_dict = {}
log_dict['epoch'] = epoch
log_dict['train loss'] = np.mean(train_loss)
log_dict['validation loss'] = _val_loss
log_dict['validation acc'] = _val_acc
wandb.log(log_dict)
'Machine Learning' 카테고리의 다른 글
왜 Batch size를 2의 거듭제곱으로 설정하는가? (0) | 2023.01.27 |
---|---|
[WandB 오류] Error while calling W&B API: entity ()not found during upsertBucket (<Response [404]>) (1) | 2023.01.27 |
[Classification] Multi-class VS. Multi-label (0) | 2023.01.21 |