InTeX icon indicating copy to clipboard operation
InTeX copied to clipboard

segmentation fault in main.py

Open forresti opened this issue 1 year ago • 0 comments

I installed your code. The only change I made to your installation recipe is to add torchvision to requirements.txt. Then I ran your example from the readme:

 python main.py --config configs/revani.yaml mesh=data/dragon.glb prompt="a red pet dragon with fire patterns" save_path=dragon_fire.glb text_dir=True

It runs for a while but fails with a segmentation fault. As you can see in the following, it doesn't say where the segmentation fault happened.

 python main.py --config configs/revani.yaml mesh=data/dragon.glb prompt="a red pet dragon with fire patterns" save_path=dragon_fire.glb text_dir=True
{'mesh': 'data/dragon.glb', 'prompt': 'a red pet dragon with fire patterns', 'seed': 'random', 'front_dir': '+z', 'outdir': 'logs', 'save_path': 'dragon_fire.glb', 'model_key': 'philz1337/revanimated', 'lora_keys': [], 'enable_lcm': False, 'posi_prompt': 'masterpiece, high quality', 'nega_prompt': 'bad quality, worst quality, shadows', 'control_mode': ['depth_inpaint'], 'text_dir': True, 'camera_path': 'front', 'bg_image': 'None', 'texture_size': 1024, 'cos_thresh': 0, 'refine_strength': 0.6, 'render_resolution': 1024, 'gui': False, 'vis': False, 'retex': False, 'remesh': False, 'H': 800, 'W': 800, 'radius': 2.5, 'fovy': 50}
/home/ubuntu/anaconda3/envs/intex3/lib/python3.12/site-packages/torch/utils/cpp_extension.py:1967: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. 
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
  warnings.warn(
[load_trimesh] load texture: (512, 512, 3)
[Mesh loading] v: torch.Size([7642, 3]), f: torch.Size([9504, 3])
/home/ubuntu/code/InTeX/InTeX/mesh.py:369: UserWarning: Using torch.cross without specifying the dim arg is deprecated.
Please either pass the dim explicitly or simply use torch.linalg.cross.
The default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at ../aten/src/ATen/native/Cross.cpp:62.)
  face_normals = torch.cross(v1 - v0, v2 - v0)
[Mesh loading] vn: torch.Size([7642, 3]), fn: torch.Size([9504, 3])
[INFO] loading guidance model...
model_index.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 584/584 [00:00<00:00, 7.80MB/s]
safety_checker/model.safetensors not found
(…)ature_extractor/preprocessor_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 520/520 [00:00<00:00, 6.86MB/s]
safety_checker/config.json: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.59k/4.59k [00:00<00:00, 32.4MB/s]
tokenizer/special_tokens_map.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 472/472 [00:00<00:00, 7.12MB/s]
scheduler/scheduler_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 465/465 [00:00<00:00, 5.93MB/s]
tokenizer/merges.txt: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 525k/525k [00:00<00:00, 61.5MB/s]
text_encoder/config.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 617/617 [00:00<00:00, 8.92MB/s]
tokenizer/tokenizer_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 737/737 [00:00<00:00, 11.0MB/s]
unet/config.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.45k/1.45k [00:00<00:00, 24.4MB/s]
vae/config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 582/582 [00:00<00:00, 8.81MB/s]
tokenizer/vocab.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.06M/1.06M [00:00<00:00, 51.2MB/s]
diffusion_pytorch_model.bin: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 335M/335M [00:06<00:00, 50.8MB/s]
pytorch_model.bin: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 492M/492M [00:09<00:00, 52.9MB/s]
pytorch_model.bin: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.22G/1.22G [00:24<00:00, 50.2MB/s]
diffusion_pytorch_model.bin: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.44G/3.44G [01:04<00:00, 53.7MB/s]
Fetching 15 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 15/15 [01:04<00:00,  4.30s/it]
Loading pipeline components...:  29%|████████████████████████████████████████████████▎                                                                                                                        | 2/7 [00:00<00:00,  6.50it/s]An error occurred while trying to fetch /home/ubuntu/.cache/huggingface/hub/models--philz1337--revanimated/snapshots/841ca0fc8ce2a54b13692fea41ae78257d20d7d8/vae: Error no file named diffusion_pytorch_model.safetensors found in directory /home/ubuntu/.cache/huggingface/hub/models--philz1337--revanimated/snapshots/841ca0fc8ce2a54b13692fea41ae78257d20d7d8/vae.
Defaulting to unsafe serialization. Pass `allow_pickle=False` to raise an error instead.
Loading pipeline components...:  43%|████████████████████████████████████████████████████████████████████████▍                                                                                                | 3/7 [00:00<00:00,  6.26it/s]/home/ubuntu/anaconda3/envs/intex3/lib/python3.12/site-packages/transformers/models/clip/feature_extraction_clip.py:28: FutureWarning: The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use CLIPImageProcessor instead.
  warnings.warn(
An error occurred while trying to fetch /home/ubuntu/.cache/huggingface/hub/models--philz1337--revanimated/snapshots/841ca0fc8ce2a54b13692fea41ae78257d20d7d8/unet: Error no file named diffusion_pytorch_model.safetensors found in directory /home/ubuntu/.cache/huggingface/hub/models--philz1337--revanimated/snapshots/841ca0fc8ce2a54b13692fea41ae78257d20d7d8/unet.
Defaulting to unsafe serialization. Pass `allow_pickle=False` to raise an error instead.
Loading pipeline components...: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:02<00:00,  3.36it/s]
config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.21k/1.21k [00:00<00:00, 18.9MB/s]
An error occurred while trying to fetch ashawkey/control_v11e_sd15_depth_aware_inpaint: ashawkey/control_v11e_sd15_depth_aware_inpaint does not appear to have a file named diffusion_pytorch_model.safetensors.
Defaulting to unsafe serialization. Pass `allow_pickle=False` to raise an error instead.
diffusion_pytorch_model.bin: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 723M/723M [00:12<00:00, 55.8MB/s]
[INFO] loaded guidance model!
[INFO] encoding prompt...
[INFO] start generation...
  0%|                                                                                                                                                                                                                | 0/11 [00:00<?, ?it/s]/home/ubuntu/anaconda3/envs/intex3/lib/python3.12/site-packages/torch/utils/cpp_extension.py:1967: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. 
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
  warnings.warn(
Segmentation fault (core dumped)

I did some debugging with print statements and isolated the segmentation fault to this line: https://github.com/ashawkey/InTeX/blob/6669e4c5ffd025a8ea2c571d81989d1a5c335ab4/main.py#L284

        rgbs = self.guidance(text_embeds, height=512, width=512, control_images=control_images, refine_strength=self.opt.refine_strength).float()

Any suggestion how to debug this?

forresti avatar Jul 11 '24 05:07 forresti