hongfz16 / AvatarCLIP

[SIGGRAPH 2022 Journal Track] AvatarCLIP: Zero-Shot Text-Driven Generation and Animation of 3D Avatars
https://hongfz16.github.io/projects/AvatarCLIP.html
Other
1.07k stars 94 forks source link

A very obvious code error in AvatarCLIP/AvatarGen/ShapeGen/main.py #21

Open Piggy-ch opened 1 year ago

Piggy-ch commented 1 year ago

in line 86-91

def load_codebook(fname):
    codebook_dict = torch.load(fname)
    for i in codebook_dict.keys():
        clip_codebook = codebook_dict[i].cuda()
        break
    return i.cuda(), clip_codebook

In this code, the variable i is used to iterate through each key, which presumably should be a string. However, it ultimately returns the string "CUDA". This code obviously cannot run. This issue prevents me from performing Coarse Shape Generation in the Avatar Generation. Additionally, I don't quite understand why the code logic breaks out of the for loop after the first iteration. As a newcomer to programming, I am uncertain about this approach.