segfault with knn2img.py
Trying the sample on a barebones fresh Ubuntu Server install.
python scripts/knn2img.py --prompt "a happy bear reading a newspaper, oil on canvas"
results in Segmentation fault (core dumped)
[ 3634.730226] python[2030]: segfault at 300000004 ip 00007f22e62442e6 sp 00007fff04937560 error 4 in _message.cpython-38-x86_64-linux-gnu.so[7f22e622d000+14e000]
[ 3634.730241] Code: 54 49 89 fc 55 31 ed 53 48 83 ec 10 eb 10 66 0f 1f 44 00 00 83 c5 01 41 39 6c 24 04 7e 5f 48 63 dd 48 c1 e3 05 49 03 5c 24 28 <48> 63 7b 04 e8 91 f3 fe ff 48 89 44 24 08 48 89 c2 48 85 c0 74 5f
Happy to provide whatever to help. Understand that it is likely an underlying issue and not something this project specfic.
Having the same issue here.
Same here, except I only get "Segmentation fault"
@PhazonJim @KobeAmerijckxPT are you able to run the other demos? I'm not because I don't have a working graphics card, and there is a bug where it should route to the CPU but doesn't in all cases. https://github.com/CompVis/latent-diffusion/issues/118
Same Segmentation fault (core dumped) issue, and it may comes from package scann.
Ditto. Here's the tail of the verbose output.
# /home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/__pycache__/descriptor.cpython-38.pyc matches /home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/descriptor.py
# code object from '/home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/__pycache__/descriptor.cpython-38.pyc'
# /home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/internal/__pycache__/__init__.cpython-38.pyc matches /home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/internal/__init__.py
# code object from '/home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/internal/__pycache__/__init__.cpython-38.pyc'
import 'google.protobuf.internal' # <_frozen_importlib_external.SourceFileLoader object at 0x7fc1a1a0a310>
# /home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/internal/__pycache__/api_implementation.cpython-38.pyc matches /home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/internal/api_implementation.py
# code object from '/home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/internal/__pycache__/api_implementation.cpython-38.pyc'
# extension module 'google.protobuf.internal._api_implementation' loaded from '/home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/internal/_api_implementation.cpython-38-x86_64-linux-gnu.so'
# extension module 'google.protobuf.internal._api_implementation' executed from '/home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/internal/_api_implementation.cpython-38-x86_64-linux-gnu.so'
import 'google.protobuf.internal._api_implementation' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc1a1a0a910>
import 'google.protobuf.internal.api_implementation' # <_frozen_importlib_external.SourceFileLoader object at 0x7fc1a1a0a4c0>
# /home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/pyext/__pycache__/__init__.cpython-38.pyc matches /home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/pyext/__init__.py
# code object from '/home/kadah/anaconda3/envs/ldm2/lib/python3.8/site-packages/google/protobuf/pyext/__pycache__/__init__.cpython-38.pyc'
import 'google.protobuf.pyext' # <_frozen_importlib_external.SourceFileLoader object at 0x7fc1a1a0a7c0>
Segmentation fault (core dumped)
Swapping to torch for cuda 11.6 (which allowed the other examples to run) had no effect.
Hi folks, I just achieved to run this by install scann seperately, you may have a try. Good luck!
I have this error as well, running on a 3090 RTX in Ubuntu. @kuri-leo pip uninstalling scann and installing did not do it for me, unfortunately. txt2img-large model works fine though.
I have this error as well, running on a 3090 RTX in Ubuntu. @kuri-leo pip uninstalling scann and installing did not do it for me, unfortunately. txt2img-large model works fine though.
Hi @palexpereira , sorry to hear that. My steps are :
- install conda dependency
conda env create -f environment.yaml
conda activate ldm
- install transformer
pip install transformers==4.19.2 - install kornia
pip install kornia==0.6.4 - install torchmetrics
pip install torchmetrics==0.6.0 - install einops
pip install git+https://github.com/arogozhnikov/einops.git - finally, install scann seperately
pip install scann
@kuri-leo unfortunately, same as the others - I did the exact same install steps you listed, and still get a segfault. I think your issue may be a different one?
@kuri-leo thanks for the help, but unfortunately it did not work. all these requirements were already satisfied
I moved the import scann call to the beginning of knn2img.py and the segmentation fault didn't occur. I don't know why that worked!
@Chreod me too, bizarre!
@kuri-leo thanks for the help, but unfortunately it did not work. all these requirements were already satisfied
That's pretty strange... I did install them seperately as well as add two print before and behind ‘import scann’ to locate the issue. This way works for me.
At least, try Chreod's solution to at least make it work
I manager to get it to work by recreating the env a few times till I accidentally forgot to install the documented additional package and went about manually resolving the missing packages instead. I do not know the exact recipe that ended working, but the main different was using current repo versions of several. Here's my conda ldm env. conda.txt
I moved the
import scanncall to the beginning ofknn2img.pyand the segmentation fault didn't occur. I don't know why that worked!
Hello, just came here to say that this solved my problem, thanks.
I moved the
import scanncall to the beginning ofknn2img.pyand the segmentation fault didn't occur. I don't know why that worked!
This works! So curious why simply changing the order will help.