zhengyuf / PointAvatar

Official Repository for CVPR 2023 paper PointAvatar: Deformable Point-based Head Avatars from Videos.
Other
317 stars 21 forks source link

"too many values to unpack (expected 2)" #29

Closed YingjunShang closed 3 months ago

YingjunShang commented 3 months ago

I'm sorry to bother you, but I still got problem when running the training code. I have already pip install the pytorch3d in your homepage, and the custom function is as follow:

class AlphaCompositor(nn.Module):
    """
    Accumulate points using alpha compositing.
    """

    def __init__(
        self, background_color: Optional[Union[Tuple, List, torch.Tensor]] = None
    ) -> None:
        super().__init__()
        self.background_color = background_color

    def forward(self, fragments, alphas, ptclds, **kwargs) -> torch.Tensor:
        background_color = kwargs.get("background_color", self.background_color)
        images = alpha_composite(fragments, alphas, ptclds)

        # images are of shape (N, C, H, W)
        # check for background color & feature size C (C=4 indicates rgba)
        if background_color is not None:
            return _add_background_color_to_images(fragments, images, background_color)
        return images

In the training code, there are: self.compositor = AlphaCompositor().cuda() and images, weights = self.compositor( fragments.idx.long().permute(0, 3, 1, 2), alphas, point_cloud.features_packed().permute(1, 0), ) And the error message is: images, weights = self.compositor( ValueError: too many values to unpack (expected 2)

I can't find where weights are computed. Could you please help me out if you are available? Thank you so much and have a nice day! Best regards, YingjunShang.

zhengyuf commented 3 months ago

did you do git checkout point-avatar as mentioned in the README?

YingjunShang commented 3 months ago

No, I can't git checkout point-avatar. When I git clone the project, I encountered:

    git clone git@github.com:zhengyuf/pytorch3d.git
    Cloning into 'pytorch3d'...

    git@github.com: Permission denied (publickey).
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

So I forked the project to my github and then download to my server. So at first there is just master branch.

I tried to set up a new branch named 'point-avatar' in the folder with "PointAvatar" folder and "pytorch3d" folder , but when I

    cd pytorch3d
    git checkout point-avatar

I encountered:

    error: pathspec 'point-avatar' did not match any file(s) known to git

The branch stucture are as follows: I think I make it in the wrong way.

image image image

I'm not farmiliar with the branch management, I don't know in which folder should I set up the branch 'point-avatar'. I feel sorry to bother you and I would appreciate it if you could reply when available.

zhengyuf commented 3 months ago

You have to git clone the repository. The error you have can be fixed by adding an ssh key to github.