witcherofresearch / Forgedit

353 stars 27 forks source link

Incorrect path to blip model #5

Closed YashKSahu closed 2 months ago

YashKSahu commented 4 months ago

While running the DreamBoothForgedit I am stuck at this error:

accelerate launch src/sample_dreambooth_batch_textencoder.py --train=False --interpolation=vp

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 "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/transformers/utils/hub.py", line 398, in cached_file
    resolved_file = hf_hub_download(
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 106, in _inner_fn
    validate_repo_id(arg_value)
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 154, in validate_repo_id
    raise HFValidationError(
huggingface_hub.errors.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/mnt/bn/editdiffusion/Forgedit/models/blip-image-captioning-base'. Use `repo_type` argument if needed.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/gans/docker/files/Forgedit/src/sample_dreambooth_batch_textencoder.py", line 61, in <module>
    processor = BlipProcessor.from_pretrained(blipmodel)
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/transformers/processing_utils.py", line 465, in from_pretrained
    args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs)
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/transformers/processing_utils.py", line 511, in _get_arguments_from_pretrained
    args.append(attribute_class.from_pretrained(pretrained_model_name_or_path, **kwargs))
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/transformers/image_processing_utils.py", line 205, in from_pretrained
    image_processor_dict, kwargs = cls.get_image_processor_dict(pretrained_model_name_or_path, **kwargs)
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/transformers/image_processing_utils.py", line 334, in get_image_processor_dict
    resolved_image_processor_file = cached_file(
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/transformers/utils/hub.py", line 462, in cached_file
    raise EnvironmentError(
OSError: Incorrect path_or_model_id: '/mnt/bn/editdiffusion/Forgedit/models/blip-image-captioning-base'. Please provide either the path to a local folder or the repo_id of a model on the Hub.
Traceback (most recent call last):
  File "/root/miniconda3/envs/forgedit/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/accelerate/commands/accelerate_cli.py", line 47, in main
    args.func(args)
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/accelerate/commands/launch.py", line 1023, in launch_command
    simple_launcher(args)
  File "/root/miniconda3/envs/forgedit/lib/python3.10/site-packages/accelerate/commands/launch.py", line 643, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/root/miniconda3/envs/forgedit/bin/python', 'src/sample_dreambooth_batch_textencoder.py', '--train=False', '--interpolation=vp']' returned non-zero exit status 1.
(forgedit) root@ubuntu24.04:/gans/docker/files/Forgedit#
witcherofresearch commented 4 months ago

Hi, you could change blipmodel='/mnt/bn/editdiffusion/Forgedit/models/blip-image-captioning-base' to blipmodel="Salesforce/blip-image-captioning-base", which I commented in line 58. It is a bit messy for the dreambooth script since I did not have enough spare time to refine it.