mlpc-ucsd/Patch-DM

train_latent error

Opened this issue · 4 comments

image

I try to run train_latent on my custom dataset but I run into NameError: free variable 'patch_num_x' referenced before assignment in enclosing scope

I guess my question is "To train latent model, we directly derive semantic embedding layers from model without additional inference." I am a bit confused about how we load these semantic codes as input

I have the same question. Did you solve it?

I have the same question. Did you solve it?

On line 432, experiment.py, I just skip log_samples when imgs = None
It would suppress the error


if self.conf.train_mode.require_dataset_infer():
    imgs = None
    idx = None
else:
    imgs = batch['img']
    idx = batch["index"]
    
    self.log_sample(x_start = imgs, step = self.global_step, idx = idx)

我有同样的问题。你解决了吗?

在第 432 行,experiment.py,我只是跳过 log_samples 当 imgs = None 它会抑制错误


if self.conf.train_mode.require_dataset_infer():
    imgs = None
    idx = None
else:
    imgs = batch['img']
    idx = batch["index"]
    
    self.log_sample(x_start = imgs, step = self.global_step, idx = idx)

Thank you for your help!