GeneFace icon indicating copy to clipboard operation
GeneFace copied to clipboard

TypeError: expected string or bytes-like object

Open WellTung666 opened this issue 2 years ago • 5 comments

你好,我按照install_guide-zh.md安装环境并验证安装后(使用的是cuda11.7),根据process_target_person_video-zh.md文件运行CUDA_VISIBLE_DEVICES=0 data_gen/nerf/process_data.sh $VIDEO_ID时出现这个错误,似乎是由transformers引起的,尝试更换版本并没有用。 geneface_error

最后运行结束会出现FileNotFoundError: [Error 2 ] No such file or directory: 'data/processed/videos/May/vid_coeff.npy'错误,请问该如何解决呢? 谢谢~

WellTung666 avatar Jul 18 '23 02:07 WellTung666

同问,一样这个问题

jessicawu11 avatar Aug 28 '23 02:08 jessicawu11

我这边处理 Obama和 Obama2,提示 Traceback (most recent call last): File "/home/tailangjun/Documents/AIGenHuman/2DHuman/GeneFace/data_gen/nerf/binarizer.py", line 277, in binarizer.parse(hparams['video_id']) File "/home/tailangjun/Documents/AIGenHuman/2DHuman/GeneFace/data_gen/nerf/binarizer.py", line 267, in parse ret = load_processed_data(processed_dir) File "/home/tailangjun/Documents/AIGenHuman/2DHuman/GeneFace/data_gen/nerf/binarizer.py", line 98, in load_processed_data coeff_dict = np.load(coeff_npy_name, allow_pickle=True).tolist() File "/opt/anaconda3/envs/geneface/lib/python3.9/site-packages/numpy/lib/npyio.py", line 390, in load fid = stack.enter_context(open(os_fspath(file), "rb")) FileNotFoundError: [Errno 2] No such file or directory: 'data/processed/videos/Obama2/vid_coeff.npy'

tailangjun avatar Sep 06 '23 11:09 tailangjun

我查了一下代码,vid_coeff.npy是第9步生成的,说明那一步执行失败了 9. calculate 3DMM python data_gen/nerf/extract_3dmm.py --video_id=$VIDEO_ID

我手动再执行一遍,会得到如下的错误 python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/opt/anaconda3/envs/geneface/lib/python3.9/site-packages/torchvision/image.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'If you don't plan on using image functionality from torchvision.io, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have libjpeg or libpng installed before building torchvision from source?

tailangjun avatar Sep 06 '23 12:09 tailangjun

问题我搞清楚了,本质问题是 torch、torchversion、pytorch3d的版本不匹配 按照 pytorch3d官网的说法,目前仅仅支持这些情况

Linux or macOS or Windows Python 3.8, 3.9 or 3.10 PyTorch 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 2.0.0 or 2.0.1.

具体的安装方法可参考 https://github.com/facebookresearch/pytorch3d/issues/1401

tailangjun avatar Sep 06 '23 18:09 tailangjun

我这边可以成功生成 vid_coeff.npy了

$ python data_gen/nerf/extract_3dmm.py --video_id=$VIDEO_ID loading the model from deep_3drecon/checkpoints/facerecon/epoch_20.pth loading video ... extracting 2D facial landmarks ...: 100%|████████████████████████████████████████████████████████████████████████████████████████████| 6455/6455 [02:07<00:00, 50.69it/s] start extracting 3DMM...: 0%| | 0/201 [00:00<?, ?it/s]create rasterizer on device cuda:0 start extracting 3DMM...: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████| 201/201 [00:15<00:00, 13.04it/s] 3DMM coeff extracted at data/processed/videos/Obama2/vid_coeff.npy

tailangjun avatar Sep 06 '23 18:09 tailangjun