EG3D-projector icon indicating copy to clipboard operation
EG3D-projector copied to clipboard

Use .pth format eg3d model will not be able to generate video

Open terencepp opened this issue 2 years ago • 9 comments

Your work is very good, but why is it impossible to generate a video using the eg3d model in .pth format, the video is black and the file size is only 5K。

terencepp avatar Aug 20 '22 10:08 terencepp

Your work is very good, but why is it impossible to generate a video using the eg3d model in .pth format, the video is black and the file size is only 5K。

Converting pkl to pth file is an optional step. You can use the .pkl model.

oneThousand1000 avatar Aug 20 '22 10:08 oneThousand1000

Yeah. Instead of using convert_pkl_2_pth.py to convert pkl to pth, I directly use pkl format, and finally run_pti.py generates a new model in .pth format, and then I then use the .pth format to generate the video, please tell me if there is a problem with my operation

terencepp avatar Aug 20 '22 11:08 terencepp

Yeah. Instead of using convert_pkl_2_pth.py to convert pkl to pth, I directly use pkl format, and finally run_pti.py generates a new model in .pth format, and then I then use the .pth format to generate the video, please tell me if there is a problem with my operation

Did you run "python gen_videos_from_given_latent_code.py --outdir=out --trunc=0.7 --npy_path ./projector_out/00018_w_plus/00018_w_plus.npy --network=./projector/PTI/checkpoints/{Your PTI ckpt}.pth --sample_mult=2" to generate the video?

Btw, could you paste the outputs of your video generating code? Is there any error or warning?

oneThousand1000 avatar Aug 20 '22 11:08 oneThousand1000

Yeah. Instead of using convert_pkl_2_pth.py to convert pkl to pth, I directly use pkl format, and finally run_pti.py generates a new model in .pth format, and then I then use the .pth format to generate the video, please tell me if there is a problem with my operation

Did you run "python gen_videos_from_given_latent_code.py --outdir=out --trunc=0.7 --npy_path ./projector_out/00018_w_plus/00018_w_plus.npy --network=./projector/PTI/checkpoints/{Your PTI ckpt}.pth --sample_mult=2" to generate the video?

Btw, could you paste the outputs of your video generating code? Is there any error or warning?

Thank,btw,I found that even if I don't use the newly modified .pth model, but use the .pkl model, I still get the above mentioned situation, here is the command and output when I run it.

CUDA_VISIBLE_DEVICES=2,3,4,5 python gen_videos_from_given_latent_code.py --outdir=out --trunc=0.7 --npy_path ./projector_out/00612_w/00612_w.npy --network=./networks/ffhq512-128.pkl --sample_mult=2 Loading networks from "./networks/ffhq512-128.pkl"... generate out/00612_w.mp4 Setting up PyTorch plugin "bias_act_plugin"... Done. Setting up PyTorch plugin "upfirdn2d_plugin"... Done. 100%|████████████████████████████████████████████████████████| 120/120 [00:48<00:00, 2.46it/s]

terencepp avatar Aug 20 '22 11:08 terencepp

I re-run the gen_videos_from_given_latent_code.py but I can't see any issue here.. (both .pth and .pkl are work.) Did you try the offcial video generating code to generate video from random sampled latent codes?

oneThousand1000 avatar Aug 20 '22 11:08 oneThousand1000

I guess you may have some environmental problems (but there is no error in your output, it is strange). Please check whether you can use the offcial video generating code to generate video from random sampled latent codes under your environment, and check your video output path.

oneThousand1000 avatar Aug 20 '22 11:08 oneThousand1000

@terencepp You use python gen_videos_from_given_latent_code.py --outdir=out --trunc=0.7 --npy_path ./projector_out/00612_w/00612_w.npy --network=./networks/ffhq512-128.pkl --sample_mult=2.

The input of the network argument may be wrong. A correct one is python gen_videos_from_given_latent_code.py --outdir=out --trunc=0.7 --npy_path ./projector_out/000567_w_plus/000567_w_plus.npy --network=./projector/PTI/checkpoints/model_IRBLASVQKWAA_000567.pth --sample_mult=2.

The network should be the trained model of PTI.

pengsida avatar Aug 20 '22 13:08 pengsida

@terencepp @oneThousand1000
HAve you resolved this problem? I also have this problem when running this repo

https://user-images.githubusercontent.com/15813059/197299716-8323da06-bd55-49a9-8647-ca32f6f24bde.mp4

hmchuong avatar Oct 21 '22 22:10 hmchuong

@terencepp @oneThousand1000 HAve you resolved this problem? I also have this problem when running this repo

00612_w_plus.mp4

Please refer to https://github.com/oneThousand1000/EG3D-projector/issues/8, and check your installations.

oneThousand1000 avatar Oct 22 '22 02:10 oneThousand1000