ZPdesu / Barbershop

Barbershop: GAN-based Image Compositing using Segmentation Masks (SIGGRAPH Asia 2021)
https://zpdesu.github.io/Barbershop/
MIT License
1.35k stars 265 forks source link

RuntimeError: std::bad_alloc #48

Open Jackson-LIMU opened 2 years ago

Jackson-LIMU commented 2 years ago

When i run python align_face.py, error will happen:

911.jpg: Number of faces detected: 1 Traceback (most recent call last): File "/data/juicefs_hz_cv_v3/11146533/Barbershop/align_face.py", line 42, in face_tensor = torchvision.transforms.ToTensor()(face).unsqueeze(0).cuda() File "/root/anaconda3/lib/python3.9/site-packages/torchvision/transforms/transforms.py", line 104, in call return F.to_tensor(pic) File "/root/anaconda3/lib/python3.9/site-packages/torchvision/transforms/functional.py", line 96, in to_tensor img = torch.ByteTensor(torch.ByteStorage.from_buffer(pic.tobytes())) RuntimeError: std::bad_alloc

Anyone help me please!

Jackson-LIMU commented 2 years ago

My gpu is Tesla V100 with 32G memory.