diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Colab Cannot Start Training

Open MushroomFleet opened this issue 3 years ago • 7 comments

Describe the bug

Import Libraries Fails

screenshot: https://i.gyazo.com/ea42aead7543ac9847412ccc554dffda.png

Think it needs updating, cannot proceed to begin training due to failure Importing

Reproduction

just start the Colab, it will fail on importing libraries. You can proceed but Training is not possible

Logs

No response

System Info

Colab

MushroomFleet avatar Oct 07 '22 13:10 MushroomFleet

Hey @MushroomFleet,

Could you please post a reproducible code snippet?

patrickvonplaten avatar Oct 07 '22 17:10 patrickvonplaten

It's a Colab and i included a screenshot. You just run the colab and it will fail to import libraries. There no code from my part ;)

On Fri, Oct 7, 2022 at 6:04 PM Patrick von Platen @.***> wrote:

Hey @MushroomFleet https://github.com/MushroomFleet,

Could you please post a reproducible code snippet?

— Reply to this email directly, view it on GitHub https://github.com/huggingface/diffusers/issues/770#issuecomment-1271838896, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABX2WY7JUFDWCM6OFFPDQDTWCBJ2HANCNFSM6AAAAAAQ7SSLEA . You are receiving this because you were mentioned.Message ID: @.***>

MushroomFleet avatar Oct 08 '22 11:10 MushroomFleet

===================================BUG REPORT=================================== Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link

CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64... CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so CUDA SETUP: Highest compute capability among GPUs detected: 7.5 CUDA SETUP: Detected CUDA version 112 CUDA SETUP: Loading binary /usr/local/lib/python3.7/dist-packages/bitsandbytes/libbitsandbytes_cuda112.so... /usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:99: UserWarning: /usr/lib64-nvidia did not contain libcudart.so as expected! Searching further paths... f'{candidate_env_vars["LD_LIBRARY_PATH"]} did not contain ' /usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:21: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('"/usr/local/bin/dap_multiplexer","enableLsp"'), PosixPath('["--ip=172.28.0.2"],"debugAdapterMultiplexerPath"'), PosixPath('"172.28.0.3","jupyterArgs"'), PosixPath('true}'), PosixPath('6000,"kernelManagerProxyHost"'), PosixPath('{"kernelManagerProxyPort"')} "WARNING: The following directories listed in your path were found to " /usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:21: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/env/python')} "WARNING: The following directories listed in your path were found to " /usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:21: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('module'), PosixPath('//ipykernel.pylab.backend_inline')} "WARNING: The following directories listed in your path were found to "

MushroomFleet avatar Oct 08 '22 11:10 MushroomFleet

import argparse
import itertools
import math
import os
from contextlib import nullcontext
import random

import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from torch.utils.data import Dataset

import PIL
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import set_seed
from diffusers import AutoencoderKL, DDPMScheduler, PNDMScheduler, StableDiffusionPipeline, UNet2DConditionModel
from diffusers.hub_utils import init_git_repo, push_to_hub
from diffusers.optimization import get_scheduler
from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
from PIL import Image
from torchvision import transforms
from tqdm.auto import tqdm
from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer

import bitsandbytes as bnb

def image_grid(imgs, rows, cols):
    assert len(imgs) == rows*cols

    w, h = imgs[0].size
    grid = Image.new('RGB', size=(cols*w, rows*h))
    grid_w, grid_h = grid.size
    
    for i, img in enumerate(imgs):
        grid.paste(img, box=(i%cols*w, i//cols*h))
    return grid```

This is the Code that exists in the section of the Colab notebook that is Failing

MushroomFleet avatar Oct 08 '22 11:10 MushroomFleet

You cannot Run the Colab without all of these dependencies. That was why i brought this to your attention.

MushroomFleet avatar Oct 08 '22 11:10 MushroomFleet

Hi @MushroomFleet! I believe those are just warnings, not errors. If you keep running the rest of the notebook it should work. If it doesn't, could you please let us know the cell where it fails and the error message that comes up?

Thanks a lot!

pcuenca avatar Oct 08 '22 11:10 pcuenca

IsADirectoryError Traceback (most recent call last) in 1 #@title Run training 2 import accelerate ----> 3 accelerate.notebook_launcher(training_function, args=(text_encoder, vae, unet)) 4 with torch.no_grad(): 5 torch.cuda.empty_cache()

8 frames /usr/local/lib/python3.7/dist-packages/PIL/Image.py in open(fp, mode) 2841 2842 if filename: -> 2843 fp = builtins.open(filename, "rb") 2844 exclusive_fp = True 2845

IsADirectoryError: [Errno 21] Is a directory: '/content/my_concept/.ipynb_checkpoints'

MushroomFleet avatar Oct 08 '22 13:10 MushroomFleet

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Nov 06 '22 15:11 github-actions[bot]

IsADirectoryError Traceback (most recent call last) in 1 #@title Run training 2 import accelerate ----> 3 accelerate.notebook_launcher(training_function, args=(text_encoder, vae, unet)) 4 with torch.no_grad(): 5 torch.cuda.empty_cache()

8 frames /usr/local/lib/python3.7/dist-packages/PIL/Image.py in open(fp, mode) 2841 2842 if filename: -> 2843 fp = builtins.open(filename, "rb") 2844 exclusive_fp = True 2845

IsADirectoryError: [Errno 21] Is a directory: '/content/my_concept/.ipynb_checkpoints'

I also feel confused with this problem. Do you resolve it recently?

Zhujx-zjjx avatar Nov 14 '23 04:11 Zhujx-zjjx