MrTornado24 / Next3D

[CVPR 2023 Highlight] Next3D: Generative Neural Texture Rasterization for 3D-Aware Head Avatars
https://mrtornado24.github.io/Next3D/
470 stars 29 forks source link

TypeError occurded when running gen_videos_next3d.py in google colab #36

Closed kieojk closed 8 months ago

kieojk commented 8 months ago

Hello, Thanks for your great work. I ran gen_videos_next3d.py in google colab, using your examlpe code showed on the github:

!python gen_videos_next3d.py --outdir=out --trunc=0.7 --seeds=10720,12374,13393,17099 --grid=2x2 \ --network=pretrained_models/next3d_ffhq_512.pkl --obj_path=data/demo/demo.obj \ --lms_path=data/demo/demo_kpt2d.txt --lms_cond=True

But typeError occurded like this:

Loading networks from "pretrained_models/next3d_ffhq_512.pkl"... Setting up PyTorch plugin "bias_act_plugin"... Done. Setting up PyTorch plugin "upfirdn2d_plugin"... Done. Traceback (most recent call last): File "/content/Next3D/gen_videos_next3d.py", line 334, in generate_images() # pylint: disable=no-value-for-parameter File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke return __callback(args, **kwargs) File "/content/Next3D/gen_videos_next3d.py", line 324, in generate_images gen_interp_video(G=G, mp4=output, verts=v, bitrate='10M', grid_dims=grid, num_keyframes=num_keyframes, w_frames=w_frames, seeds=seeds, shuffle_seed=shuffle_seed, psi=truncation_psi, truncation_cutoff=truncation_cutoff, cfg=cfg, image_mode=image_mode, save_root=save_root) File "/content/Next3D/gen_videos_next3d.py", line 105, in gen_interpvideo = G.synthesis(ws[:1], c[:1], verts[:1]) # warm up File "", line 154, in synthesis File "/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py", line 3924, in interpolate raise TypeError( TypeError: expected size to be one of int or Tuple[int] or Tuple[int, int] or Tuple[int, int, int], but got size with types [<class 'numpy.int64'>, <class 'numpy.int64'>]

360截图20240203231304549

env in colab:

python-utils 3.8.2 pytorch3d 0.7.5 python 3.10 torch 2.1.0+cu121 torchaudio 2.1.0+cu121 torchdata 0.7.0