Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation Stuck at 0% with Emojich Model #137

Open
thomasperge opened this issue Aug 5, 2024 · 0 comments
Open

Generation Stuck at 0% with Emojich Model #137

thomasperge opened this issue Aug 5, 2024 · 0 comments

Comments

@thomasperge
Copy link

thomasperge commented Aug 5, 2024

When running the emoji generation script with the Emojich model, the process gets stuck at 0% and does not progress. The model initializes correctly but doesn’t generate any images.

Environment :
OS: Windows
Python Version: [v3.10.10]
pip Version: 24.2
rudalle Version: 1.1.3
torch Version: 2.4.0
tokenizers Version : 0.10.3

My script :

from rudalle.pipelines import generate_images, show
from rudalle import get_rudalle_model, get_tokenizer, get_vae
from rudalle.utils import seed_everything
import torch

device = 'cuda' if torch.cuda.is_available() else 'cpu'
fp16 = torch.cuda.is_available()

try:
    dalle = get_rudalle_model('Emojich', pretrained=True, fp16=fp16, device=device)
except RuntimeError as e:
    if 'Attempting to deserialize object on a CUDA device' in str(e):
        dalle = get_rudalle_model('Emojich', pretrained=True, fp16=False, device='cpu')
    else:
        raise

tokenizer = get_tokenizer()
vae = get_vae(dwt=True).to(device)

text = 'Дональд Трамп из лего'  # Donald Trump made of LEGO

seed_everything(42)

pil_images = []

try:
    for top_k, top_p, images_num in [
        (2048, 0.9, 4),
    ]:
        images, _ = generate_images(text, tokenizer, dalle, vae, top_k=top_k, images_num=images_num, top_p=top_p, bs=8)
        pil_images.extend(images)
except Exception as e:
    print(f"An error occurred: {e}")

if pil_images:
    show(pil_images, 4)
else:
    print("No images to display.")

Error Messages :

Using device: cpu
...
Generating images with top_k=256, top_p=0.9, images_num=4
0%| 

Feel free to adjust any details as needed!
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant