NVlabs / affordance_diffusion

Codes for "Affordance Diffusion: Synthesizing Hand-Object Interactions"
https://github.com/NVlabs/affordance_diffusion/blob/master
106 stars 7 forks source link

Errors in data generation #16

Closed lym29 closed 6 months ago

lym29 commented 8 months ago

Hi, I've encountered an issue similar to the one previously documented as issue #14.

Specifically, in the Text2ImUNet model, the in_channel parameter is set to 3, whereas in the provided checkpoint, the in_channel appears to be 7. I'm uncertain if my approach to resolving this inconsistency is correct. While my adjustments did address the initial model loading problem, they have unfortunately led to a new issue.

Here is my modification: just change the name of ckpt in load_base()

if args.base_ckpt is None:
        # model.load_state_dict(load_checkpoint('base-inpaint', device))
        model.load_state_dict(load_checkpoint('base', device))

The dimension mismatch error has been resolved, but I've now encountered a different issue within the generate_data:

File "/public/home/v-liuym/projects/affordance_diffusion/preprocess/../glide_text2im/gaussian_diffusion.py", line 413, in p_sample_loop
    for sample in self.p_sample_loop_progressive(
  File "/public/home/v-liuym/projects/affordance_diffusion/preprocess/../glide_text2im/gaussian_diffusion.py", line 465, in p_sample_loop_progressive
    out = self.p_sample(
  File "/public/home/v-liuym/projects/affordance_diffusion/preprocess/../glide_text2im/gaussian_diffusion.py", line 364, in p_sample
    out = self.p_mean_variance(
  File "/public/home/v-liuym/projects/affordance_diffusion/preprocess/../glide_text2im/respace.py", line 116, in p_mean_variance
    return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
  File "/public/home/v-liuym/projects/affordance_diffusion/preprocess/../glide_text2im/gaussian_diffusion.py", line 258, in p_mean_variance
    model_output = model(x, t, **model_kwargs)
  File "/public/home/v-liuym/projects/affordance_diffusion/preprocess/../glide_text2im/respace.py", line 146, in __call__
    return self.model(x, new_ts, **kwargs)
  File "generate_data.py", line 161, in model_fn
    model_out = model(combined, ts, **kwargs)
  File "/public/home/v-liuym/.conda/envs/afford_diff/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'inpaint_image'

I think I've narrowed down the problem to the setup args for the diffusion model, at least that's what it looks like from the definition here But no luck fixing it yet. Would be awesome if you could give me a hand with this! @JudyYe