Git Product home page Git Product logo

dreambooth-tutorial's Introduction

Hey, I'm Alexandre Aka Dpbm 🇧🇷

I'm a computer science student and quantum computing enthusiast.

Interests

Everything about computer, programming, and technology in general.
Now days I'm in love with quantum computing, machine learning and low level programming.

You can find me at:

Medium Badge Kaggle Badge
Pypi Badge ProtonDB Linkedin Firefox Rust Itch.io

TECHNOLOGIES

NEXT JS C PYTHON Qiskit JavaScript

Github STATUS

Stats Streak View count

dreambooth-tutorial's People

Contributors

dpbm avatar eriveltonlima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dreambooth-tutorial's Issues

(usando o GoogleDrive) Não é um problema, é uma dica!

Tentei de várias formas entrar em contato com o Dpbm, e não consegui. Então por aqui estou dando a dica de seguir o recente tutorial do Bruno Sarttori, no twitter, que ele demostrou uma maneira aperfeiçoada que permite salvar os dados treinados no seu google drive pra, até onde entendi, salvar as imagens já treinadas. Não precisando ficar esperando 30 minutos ou 1h cada vez que for executar os códigos. Apenas para cada treinamento diferente.

Caso seja necessário eu deleto esse issue, ou fecho ele após disseminar essa útil dica do Sarttori.

Erro na etapa 12, na aba Inference

Ao realizar o passo a passo, na etapa 12 estou recebendo a seguinte mensagem de erro:

image

Queria saber se você consegue me ajudar a arrumar, muito obrigado!

Inference error

Pra mim está aparecendo assim:

image

Pastinha ok, não marquei o Google Drive.

Alguma ideia do que esteja ocorrendo?

Install xformers from precompiled wheel. ERROR

  • Estou tendo erro quando vou instalar o xformers

  • Quando termina de rodar fica verde, mas com essa mensagem de erro

ERROR: xformers-0.0.14.dev0-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.

  • Consigo o rodar o restante ate o ponto "Run to generate a grid of preview images from the last saved weights."

IndexError Traceback (most recent call last)
in
8
9 row = len(folders)
---> 10 col = len(os.listdir(os.path.join(weights_folder, folders[0], "samples")))
11 scale = 4
12 fig, axes = plt.subplots(row, col, figsize=(colscale, rowscale), gridspec_kw={'hspace': 0, 'wspace': 0})

IndexError: list index out of range

  • Quando chega aqui aqui da vermelho e não deixa rodar o restante, acretido que tenha haver com o xformers que deu error

Dessa vez esta dando erro em tudo

Eu botei uma outra token, não repara no nome que eu botei, olha aqui, pena que não deu pra por, eu não tenho computador pra fazer mas enfim. Eu fiz tudo certo.
Screenshot_20221208-150403_Chrome
Screenshot_20221208-150407_Chrome
Screenshot_20221208-150413_Chrome
Screenshot_20221208-150419_Chrome

Dúvida: Passo 11

image
No passo 11 está dando essa mensangem, de que OUTPUT_DIR não está definido.

Não achei a solução no fórum.

NameError Traceback (most recent call last)
in
4 import matplotlib.image as mpimg
5
----> 6 weights_folder = OUTPUT_DIR
7 folders = sorted([f for f in os.listdir(weights_folder) if f != "0"], key=lambda x: int(x))
8

NameError: name 'OUTPUT_DIR' is not defined

Erro - Inference

problema

Estou com erro nessa parte do processo, coloquei "" em stable_diffusion_weights/zwx - como também utilizei de outros artifícios que estão em "Erro no preview das imagens e erro no prompt", que infelizmente não resolveram. Alguém poderia me ajudar?

Resultados em qualidade baixa entre versões

Olha eu aqui de novo :)

Parabéns pela nova interface, ficou bem mais prática que a versão anterior, porém os resultados estão muito diferentes para mim. Houve alguma mudança na AI? Vou por alguns exemplos que fiz no antes e depois, exatamente as mesmas selfies e prompt para comparação mesmo! Tenho a impressão que algumas palavras não estão sendo lidas, ou ignoradas na nova versão. Vamos lá!

VERSÃO ANTERIOR: ficaram muito parecidas comigo
tmpbegezgrm
tmpumse64f4
tmpuwcr8iru

VERSÃO ATUAL: não lembram a mim nem de longe, inclusive botou um óculos q eu não usei em nenhuma das selfies, fiz umas 50 imagens e nada.
2caaaeed-3df7-4156-adc1-fce4adee6083
5a246571-8d83-49b1-8b1e-3d32547a1b17
9f16e58e-ab28-4152-b256-aa1cb9e9dd04
d994bb22-3a64-4647-9fe0-8b1ec8cd5ed9
f5c7f2d8-b408-4a7f-aab9-e9750b709a76

prompt usado: portrait of rafa as a viking king, long blond hair, long beard, blue eyes, sharp focus, highly detailed, canon 5d, 50mm, 8k,

HFVALIDATION ERROR - REPO NAME

Quando boto pra rodar ele fica:

HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name':
'/content/drive/MyDrive/stable_diffusion_weights/zwx/800'. Use repo_type argument if needed.

O que faço?

Aceitar os termos no huggingface

Olá, não sou muito avançado, mas não consegui localizar como aceitar os termos do huggingface, vi na comunidade bastante gente tendo o mesmo tipo de problema e nenhuma solução clara.

[ERRO] Estou tendo problema ao dar launch no dreambooth para começar a treinar a IA com meu rosto.

O erro que aparece ao dar run na célula é esse:

The following values were not passed to accelerate launchand had defaults used instead:--num_processeswas set to a value of1 --num_machineswas set to a value of1 --mixed_precisionwas set to a value of'no' --num_cpu_threads_per_processwas set to1to improve out-of-box performance To avoid this warning pass in values for each of the problematic parameters or runaccelerate config`.
/usr/local/lib/python3.8/dist-packages/xformers/_C.so: undefined symbol: _ZNK3c104impl13OperatorEntry20reportSignatureErrorENS0_12CppSignatureE
WARNING: /usr/local/lib/python3.8/dist-packages/xformers/_C.so: undefined symbol: _ZNK3c104impl13OperatorEntry20reportSignatureErrorENS0_12CppSignatureE
Need to compile C++ extensions to get sparse attention support. Please run python setup.py build develop
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/diffusers/configuration_utils.py", line 324, in load_config
config_file = hf_hub_download(
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
validate_repo_id(arg_value)
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_validators.py", line 172, in validate_repo_id
raise HFValidationError(
huggingface_hub.utils.validators.HFValidationError: Repo id must use alphanumeric chars or '-', '', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: ''.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_dreambooth.py", line 822, in
main(args)
File "train_dreambooth.py", line 448, in main
pipeline = StableDiffusionPipeline.from_pretrained(
File "/usr/local/lib/python3.8/dist-packages/diffusers/pipeline_utils.py", line 447, in from_pretrained
config_dict = cls.load_config(
File "/usr/local/lib/python3.8/dist-packages/diffusers/configuration_utils.py", line 361, in load_config
raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co/' to load this model, couldn't find it in the cached files and it looks like is not the path to a directory containing a model_index.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'.
Traceback (most recent call last):
File "/usr/local/bin/accelerate", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/accelerate_cli.py", line 43, in main
args.func(args)
File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 837, in launch_command
simple_launcher(args)
File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 354, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', 'train_dreambooth.py', '--pretrained_model_name_or_path=', '--pretrained_vae_name_or_path=stabilityai/sd-vae-ft-mse', '--output_dir=', '--revision=fp16', '--with_prior_preservation', '--prior_loss_weight=1.0', '--seed=1337', '--resolution=512', '--train_batch_size=1', '--train_text_encoder', '--mixed_precision=fp16', '--use_8bit_adam', '--gradient_accumulation_steps=1', '--learning_rate=1e-6', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--num_class_images=50', '--sample_batch_size=4', '--max_train_steps=800', '--save_interval=10000', '--save_sample_prompt=cauabs', '--concepts_list=concepts_list.json']' returned non-zero exit status 1.`

Erro no preview das imagens e erro no prompt

No campo "Run to generate a grid of preview images from the last saved weights." está acontecendo o seguinte erro:

IndexError Traceback (most recent call last)
in
8
9 row = len(folders)
---> 10 col = len(os.listdir(os.path.join(weights_folder, folders[0], "samples")))
11 scale = 4
12 fig, axes = plt.subplots(row, col, figsize=(colscale, rowscale), gridspec_kw={'hspace': 0, 'wspace': 0})

IndexError: list index out of range

No campo "Run for generating images." está acontecendo o seguinte erro:

NameError Traceback (most recent call last)
in
10
11 with autocast("cuda"), torch.inference_mode():
---> 12 images = pipe(
13 prompt,
14 height=height,

NameError: name 'pipe' is not defined

Sabe o que posso estar fazendo de errado?

Erro no inference e para gerar preview das imagens

Estou tendo dois erros, um deles é no [8] - NameError: name 'OUTPUT_DIR' is not defined
E no [14] - OSError: We couldn't connect to 'https://huggingface.co/' to load this model, couldn't find it in the cached files and it looks like /content/drive/MyDrive/stable_diffusion_weights/zwx/800 is not the path to a directory containing a model_index.json file.
O erro do 14 já testei de duas formas, da forma que está no tutorial e na forma que está em um dos issues, mas continua apresentando o mesmo erro.
Não encontrei nenhum botão para que o modelo interaja com minha conta do HuggingFace (não sei se pode ser esse o problema)

error

estou com erro ao aceitar a minha conta do HuggingFace

Colab e GPU

Fiz uma primeira tentativa e no meio do treinamento o colab desconectou do ambiente de execução. Depois disse: Não é possível conectar ao back-end da GPU

O que fazer nesse caso? Obrigado

problema com o path do modelo

a instrução 12 diz:
Na seção Inference, mude a variável model_path de WEIGHTS_DIR para "stable_diffusion_weights/zwx/800"
Porém ao mudar a variável ocorre a mensagem de erro:
OSError: We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like stable_diffusion_weights/zwx/800 is not the path to a directory containing a model_index.json file.Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'. site:stackoverflow.com

mateus

#@markdown 🏃‍♂️ Rode esta célula para instalar as dependencias necessárias
!rm -rf train_dreambooth.py convert_diffusers_to_original_stable_diffusion.py
!wget -q https://github.com/ShivamShrirao/diffusers/raw/main/examples/dreambooth/train_dreambooth.py
!wget -q https://github.com/ShivamShrirao/diffusers/raw/main/scripts/convert_diffusers_to_original_stable_diffusion.py
%pip install -qq git+https://github.com/ShivamShrirao/diffusers
%pip install -q -U --pre triton
%pip install -q accelerate transformers ftfy bitsandbytes==0.35.0 gradio natsort safetensors xformers

sessão 12

Não estou certo de que estou fazendo a coisa correta, porém até aqui tem ido tudo certo.
Na sessão 12, quando eu vou pra rodar a célula ele me dá o seguinte erro:

image

O caminho ali em "zwx" eu devo mudar também ou não? Porque eu mudei onde foi falado pra mudar, mas não nesse trecho que não foi especificado.
Valeu!

Problema ao criar pasta

Olá pessoal, eu não manjo nada de códigos mas usava o tutorial antigo sem problemas e usei ontem inclusive quando encontrei o erro que descreverei. Muito obrigado por tudo! Esse novo formato está bem legal, porém não estou conseguindo rodar o passo 2. Dou a permissão para acessar meu drive, mas recebo erro abaixo, vou colar o print pra deixar mais claro.

erro1

accelerate: command not found

Ao executar o bloco 14, o mesmo é executado com sucesso no Google Colab
mas o comando em si dentro do bloco parece não ser executado.

/bin/bash: accelerate: command not found

Screen Shot 2022-12-01 at 16 51 22

E consequentimente tive os problemas comuns relatado no Readme, mesmo fazendo as devidas alterações sugeridas:

Screen Shot 2022-12-01 at 16 52 22

ERRO CRIAÇÃO DA PASTA 800

erro
Bom dia, está dando esse erro e acredito seja porquê não está criando a pasta 800.Alguém achou uma solução.?

salvar imagens

Olá ! consegui seguir todo o fluxo e gerei as imagens. Porém, não consigo salvá-las. Clico com o direito do mouse > salvar imagem como... ele salva a imagem como um .pgn de 1kb... não consigo abrir...

Como faz pra salvar as imagens geradas:?

parte 51

a parte de número 51 não funciona e exibe essa mensagem

(ps: sou 100% leigo em programação, cheguei ao tutorial por um fio/thread no twitter):


HFValidationError Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/diffusers/configuration_utils.py in load_config(cls, pretrained_model_name_or_path, return_unused_kwargs, **kwargs)
323 # Load from URL or cache if already cached
--> 324 config_file = hf_hub_download(
325 pretrained_model_name_or_path,

4 frames
HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'stable_diffusion_weights/zwx/800'. Use repo_type argument if needed.

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/diffusers/configuration_utils.py in load_config(cls, pretrained_model_name_or_path, return_unused_kwargs, **kwargs)
359 )
360 except ValueError:
--> 361 raise EnvironmentError(
362 f"We couldn't connect to '{HUGGINGFACE_CO_RESOLVE_ENDPOINT}' to load this model, couldn't find it"
363 f" in the cached files and it looks like {pretrained_model_name_or_path} is not the path to a"

OSError: We couldn't connect to 'https://huggingface.co/' to load this model, couldn't find it in the cached files and it looks like stable_diffusion_weights/zwx/800 is not the path to a directory containing a model_index.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.