huanngzh/threestudio-dreamwaltz

error running launch.py - ImportError: cannot import name 'bool' from 'numpy'

Closed this issue · 1 comments

(pytorch3d) andy@andys-pc:~/threestudio$ python launch.py --config custom/threestudio-dreamwaltz/configs/dreamwaltz-static.yaml --train --gpu 0 system.prompt_processor.prompt="Naruto"
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/torchvision/image.so: undefined symbol: _ZN3c106detail23torchInternalAssertFailEPKcS2_jS2_RKSs'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?
  warn(
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/controlnet_aux/mediapipe_face/mediapipe_face_common.py:7: UserWarning: The module 'mediapipe' is not installed. The package will have limited functionality. Please install it using the command: pip install 'mediapipe'
  warnings.warn(
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_5m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_5m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_11m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_11m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_384 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_384. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_512 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_512. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
    PyTorch 2.2.0+cu121 with CUDA 1201 (you have 2.1.2.post301)
    Python  3.9.18 (you have 3.9.18)
  Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
  Memory-efficient attention, SwiGLU, sparse and more won't be available.
  Set XFORMERS_MORE_DETAILS=1 for more details

Import times for custom modules:
   0.0 seconds: custom/threestudio-animate124
   0.9 seconds: custom/threestudio-dreamwaltz

Seed set to 0
[INFO] Using prompt [Naruto] and negative prompt []
[INFO] Using view-dependent prompts [side]:[Naruto, side view] [front]:[Naruto, front view] [back]:[Naruto, back view] [overhead]:[Naruto, overhead view]
[INFO] Loading Multi-ControlNet...
[INFO] Loaded Multi-ControlNet!
[INFO] Using 16bit Automatic Mixed Precision (AMP)
[INFO] GPU available: True (cuda), used: True
[INFO] TPU available: False, using: 0 TPU cores
[INFO] IPU available: False, using: 0 IPUs
[INFO] HPU available: False, using: 0 HPUs
[INFO] You are using a CUDA device ('NVIDIA GeForce RTX 3060') that has Tensor Cores. To properly utilize them, you should set `torch.set_float32_matmul_precision('medium' | 'high')` which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.str` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
Traceback (most recent call last):
  File "/home/andy/threestudio/launch.py", line 301, in <module>
    main(args, extras)
  File "/home/andy/threestudio/launch.py", line 244, in main
    trainer.fit(system, datamodule=dm, ckpt_path=cfg.resume)
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 543, in fit
    call._call_and_handle_interrupt(
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/pytorch_lightning/trainer/call.py", line 44, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 579, in _fit_impl
    self._run(model, ckpt_path=ckpt_path)
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 948, in _run
    call._call_setup_hook(self)  # allow user to set up LightningModule in accelerator environment
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/pytorch_lightning/trainer/call.py", line 92, in _call_setup_hook
    _call_lightning_datamodule_hook(trainer, "setup", stage=fn)
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/pytorch_lightning/trainer/call.py", line 179, in _call_lightning_datamodule_hook
    return fn(*args, **kwargs)
  File "/home/andy/threestudio/custom/threestudio-dreamwaltz/data/smpl_prior.py", line 300, in setup
    self.train_dataset = RandomSMPLPriorCameraIterableDataset(self.cfg)
  File "/home/andy/threestudio/custom/threestudio-dreamwaltz/data/smpl_prior.py", line 50, in __init__
    self.smpl_prompt = SMPLPrompt(
  File "/home/andy/threestudio/custom/threestudio-dreamwaltz/utils/smpl/smpl_prompt.py", line 1288, in __init__
    self.hs = CanonicalScene(scene=scene, offset_y=smpl_offset_y)
  File "/home/andy/threestudio/custom/threestudio-dreamwaltz/utils/smpl/smpl_prompt.py", line 1129, in __init__
    smpl = MySMPL(batch_size=self.num_person, model_type=model_type)
  File "/home/andy/threestudio/custom/threestudio-dreamwaltz/utils/smpl/smpl_prompt.py", line 575, in __init__
    self.model = smplx.create(**smpl_cfgs)
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/smplx/body_models.py", line 2400, in create
    return SMPL(model_path, **kwargs)
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/smplx/body_models.py", line 137, in __init__
    data_struct = Struct(**pickle.load(smpl_file,
  File "/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/chumpy/__init__.py", line 11, in <module>
    from numpy import bool, int, float, complex, object, unicode, str, nan, inf
ImportError: cannot import name 'bool' from 'numpy' (/home/andy/miniconda3/envs/pytorch3d/lib/python3.9/site-packages/numpy/__init__.py)```

Please try using version 1.23.0 of the numpy package.