dvlab-research / ControlNeXt

Controllable video and image Generation, SVD, Animate Anyone, ControlNet, ControlNeXt, LoRA
Apache License 2.0
1.39k stars 66 forks source link

ModuleNotFoundError: No module named 'datasets' #31

Open ManuelSerna opened 2 months ago

ManuelSerna commented 2 months ago

Hello,

Thank you for your very interesting work. I tried to train the SDXL model by running the script, below.

bash examples/vidit_depth/train.sh

However, I received the below error, which seems to indicate missing modules, perhaps?

The following values were not passed to `accelerate launch` and had defaults used instead:
        `--num_processes` was set to a value of `1`
        `--num_machines` was set to a value of `1`
        `--mixed_precision` was set to a value of `'no'`
        `--dynamo_backend` was set to a value of `'no'`
To avoid this warning pass in values for each of the problematic parameters or run `accelerate config`.
Traceback (most recent call last):
  File "train_controlnext.py", line 37, in <module>
    from datasets import load_dataset
ModuleNotFoundError: No module named 'datasets'
Traceback (most recent call last):
  File "/home/mserna/install/anaconda3/envs/control/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/home/mserna/install/anaconda3/envs/control/lib/python3.8/site-packages/accelerate/commands/accelerate_cli.py", line 48, in main
    args.func(args)
  File "/home/mserna/install/anaconda3/envs/control/lib/python3.8/site-packages/accelerate/commands/launch.py", line 1106, in launch_command
    simple_launcher(args)
  File "/home/mserna/install/anaconda3/envs/control/lib/python3.8/site-packages/accelerate/commands/launch.py", line 704, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/home/mserna/install/anaconda3/envs/control/bin/python', 'train_controlnext.py', '--pretrained_model_name_or_path', 'stabilityai/stable-diffusion-xl-base-1.0', '--pretrained_vae_model_name_or_path', 'madebyollin/sdxl-vae-fp16-fix', '--variant', 'fp16', '--use_safetensors', '--output_dir', 'train/example', '--logging_dir', 'logs', '--resolution', '1024', '--gradient_checkpointing', '--set_grads_to_none', '--proportion_empty_prompts', '0.2', '--controlnet_scale_factor', '1.0', '--mixed_precision', 'fp16', '--enable_xformers_memory_efficient_attention', '--dataset_name', 'Nahrawy/VIDIT-Depth-ControlNet', '--image_column', 'image', '--conditioning_image_column', 'depth_map', '--caption_column', 'caption', '--validation_prompt', 'a stone tower on a rocky island', '--validation_image', 'examples/vidit_depth/condition_0.png']' returned non-zero exit status 1.

If I need to fix a reference or install something new, I would be happy to do so. Thank you for your help!

Eugeoter commented 2 months ago

There's a missing package dependency. Just run pip install datasets to install it. I've updated the requirements.txt. Sorry for the inconvenience.