zhanglonghao1992 / One-Shot_Free-View_Neural_Talking_Head_Synthesis

Pytorch implementation of paper "One-Shot Free-View Neural Talking-Head Synthesis for Video Conferencing"
Other
764 stars 143 forks source link

代码中的一些小bug #7

Closed DWCTOD closed 2 years ago

DWCTOD commented 2 years ago

您好, 大佬您好,经过尝试,好像可以训练起来了,train_vis 的图: 631072239995 目前仅用了几个视频训练,发现特别的慢,不知道大佬可否分享一下预训练的权重?谢谢啦 另外,model.py 中的driving_224 和 transform_hopenet 似乎存在一定的问题。

zhanglonghao1992 commented 2 years ago

hopenet那里存在什么问题呢

DWCTOD commented 2 years ago

hopenet那里存在什么问题呢

类似这样子的错误: 1、img should be PIL Image. Got <class 'torch.Tensor'> 2、Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 我这边是修改了 transform_hopenet = transforms.Compose()里面的内容 + driving_224=transform_hopenet(xxx) ,里面 xxx 的转换

zhanglonghao1992 commented 2 years ago

我这边训练完全没有你说的这两个问题

DWCTOD commented 2 years ago

我这边训练完全没有你说的这两个问题

这样子啊,会不会是pytorch 版本的问题?我这边使用的是pytorch1.6

zhanglonghao1992 commented 2 years ago

你这个第二条错误明显是因为input就没有在gpu上

DWCTOD commented 2 years ago

你这个第二条错误明显是因为input就没有在gpu上

是的呀,后面改了。我再研究一下源码,谢谢大佬的分享。 大佬有计划分享一下模型的权重吗?

zhanglonghao1992 commented 2 years ago

你这个第二条错误明显是因为input就没有在gpu上

是的呀,后面改了。我再研究一下源码,谢谢大佬的分享。 大佬有计划分享一下模型的权重吗?

等我这边用vox2训好就分享checkpoint,话说vox2有点大,处理得有点慢

clumsynope commented 2 years ago

hopenet那里存在什么问题呢

类似这样子的错误: 1、img should be PIL Image. Got <class 'torch.Tensor'> 2、Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 我这边是修改了 transform_hopenet = transforms.Compose()里面的内容 + driving_224=transform_hopenet(xxx) ,里面 xxx 的转换

hopenet那里存在什么问题呢

类似这样子的错误: 1、img should be PIL Image. Got <class 'torch.Tensor'> 2、Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 我这边是修改了 transform_hopenet = transforms.Compose()里面的内容 + driving_224=transform_hopenet(xxx) ,里面 xxx 的转换

@DWCTOD 我也遇到了一样的问题,辛苦问一下你是怎么解决的

zhuhaozh commented 2 years ago

等我这边用vox2训好就分享checkpoint,话说vox2有点大,处理得有点慢

期待!!!

DWCTOD commented 2 years ago

hopenet那里存在什么问题呢

类似这样子的错误: 1、img should be PIL Image. Got <class 'torch.Tensor'> 2、Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 我这边是修改了 transform_hopenet = transforms.Compose()里面的内容 + driving_224=transform_hopenet(xxx) ,里面 xxx 的转换

hopenet那里存在什么问题呢

类似这样子的错误: 1、img should be PIL Image. Got <class 'torch.Tensor'> 2、Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 我这边是修改了 transform_hopenet = transforms.Compose()里面的内容 + driving_224=transform_hopenet(xxx) ,里面 xxx 的转换

@DWCTOD 我也遇到了一样的问题,辛苦问一下你是怎么解决的

这里好像默认是必须使用多卡训练的,如果你没有使用多卡会存在一定问题。 driving_224 这边的话,报错可以修改成 driving_224 = transform_hopenet(x['driving].cpu().numpy().astype(uint8).squeeze(0)).unsqueeze(0).cuda() 同时对transform_hopenet 进行一定的修改 在transforms.Compose 中的transfoms.Rezise 前面加 transforms.ToPILImage(),transfoms.Rezise 后面加 transforms.ToTensor() 我这样子改就能跑起来了,感觉有点乱,方法不一定对,你可以试试

clumsynope commented 2 years ago

hopenet那里存在什么问题呢

类似这样子的错误: 1、img should be PIL Image. Got <class 'torch.Tensor'> 2、Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 我这边是修改了 transform_hopenet = transforms.Compose()里面的内容 + driving_224=transform_hopenet(xxx) ,里面 xxx 的转换

hopenet那里存在什么问题呢

类似这样子的错误: 1、img should be PIL Image. Got <class 'torch.Tensor'> 2、Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 我这边是修改了 transform_hopenet = transforms.Compose()里面的内容 + driving_224=transform_hopenet(xxx) ,里面 xxx 的转换

@DWCTOD 我也遇到了一样的问题,辛苦问一下你是怎么解决的

这里好像默认是必须使用多卡训练的,如果你没有使用多卡会存在一定问题。 driving_224 这边的话,报错可以修改成 driving_224 = transform_hopenet(x['driving].cpu().numpy().astype(uint8).squeeze(0)).unsqueeze(0).cuda() 同时对transform_hopenet 进行一定的修改 在transforms.Compose 中的transfoms.Rezise 前面加 transforms.ToPILImage(),transfoms.Rezise 后面加 transforms.ToTensor() 我这样子改就能跑起来了,感觉有点乱,方法不一定对,你可以试试

好像和torch的版本有关,我目前python为3.7.5 torch 1.7.1 torchaudio 0.7.0a0+a853dff torchvision 0.8.2 就没有报错了