Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About train_util.py #4

Open
Devil-Ideal opened this issue Jun 14, 2023 · 0 comments
Open

About train_util.py #4

Devil-Ideal opened this issue Jun 14, 2023 · 0 comments

Comments

@Devil-Ideal
Copy link

During training, the while loop in the 'run_loop' function does not seem to terminate because self. lr_ annel_ Steps=0, not self. lr_ annel_ Steps are always true.

the code is below:
segmentation_train.py
def create_argparser():
defaults = dict(
data_dir="./data/training",
schedule_sampler="uniform",
lr=1e-4,
weight_decay=0.0,
lr_anneal_steps=0,
batch_size=1,
microbatch=-1, # -1 disables microbatches
ema_rate="0.9999", # comma-separated list of EMA values
log_interval=100,
save_interval=5000,
resume_checkpoint='',#'"./results/pretrainedmodel.pt",
use_fp16=False,
fp16_scale_growth=1e-3,
)
train_util.py
class TrainLoop:
def init(
self,
*,
model,
classifier,
diffusion,
data,
dataloader,
prior,
posterior,
batch_size,
microbatch,
lr,
ema_rate,
log_interval,
save_interval,
resume_checkpoint,
use_fp16=False,
fp16_scale_growth=1e-3,
schedule_sampler=None,
weight_decay=0.0,
lr_anneal_steps=0,
):

def run_loop(self):
    i = 0
    totseg = 0
    totcls = 0
    totrec=0
    data_iter = iter(self.dataloader)
    while (
        not self.lr_anneal_steps
        or self.step + self.resume_step < self.lr_anneal_steps
    ):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant