# Git lfs error on training diffusers

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [February 24, 2023, 7:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465 "2023-02-24T19:38:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwitiderrick](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mwitiderrick/32/17324_2.png) [@mwitiderrick](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmwitiderrick)%5C
**Post date:** [February 24, 2023, 7:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%2F1 "2023-02-24T19:38:36Z")

</div>

Getting this error on this notebook [notebooks/training\_example.ipynb at main · huggingface/notebooks · GitHub](https://github.com/huggingface/notebooks/blob/main/diffusers/training_example.ipynb)

```auto
Launching training on one GPU.
Cloning https://huggingface.co/mwitiderrick/catsdiffusion into local empty directory.
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/huggingface_hub/repository.py in clone_from(self, repo_url, token)
    691 self.local_dir,
--> 692 env=env,
    693 )

/opt/conda/lib/python3.7/site-packages/huggingface_hub/utils/_subprocess.py in run_subprocess(command, folder, check, **kwargs)
     68 cwd=folder or os.getcwd(),
---> 69 **kwargs,
     70 )

/opt/conda/lib/python3.7/subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    511 raise CalledProcessError(retcode, process.args,
--> 512 output=stdout, stderr=stderr)
    513 return CompletedProcess(process.args, retcode, stdout, stderr)

CalledProcessError: Command '['git', 'lfs', 'clone', 'https://user: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@huggingface.co/mwitiderrick/catsdiffusion', '.']' returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
/tmp/ipykernel_23/2823307728.py in <module>
      2 args = (config, model, noise_scheduler, optimizer, train_dataloader, lr_scheduler)
      3 
----> 4 notebook_launcher(train_loop, args, num_processes=1)

/opt/conda/lib/python3.7/site-packages/accelerate/launchers.py in notebook_launcher(function, args, num_processes, use_fp16, mixed_precision, use_port)
     81 else:
     82 print("Launching training on one CPU.")
---> 83 function(*args)
     84 
     85 else:

/tmp/ipykernel_23/3930790771.py in train_loop(config, model, noise_scheduler, optimizer, train_dataloader, lr_scheduler)
     26 if config.push_to_hub:
     27 repo_name = get_full_repo_name(Path(config.output_dir).name)
---> 28 repo = Repository(config.output_dir, clone_from=repo_name)
     29 elif config.output_dir is not None:
     30 os.makedirs(config.output_dir, exist_ok=True)

/opt/conda/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
    122 )
    123 
--> 124 return fn(*args, **kwargs)
    125 
    126 return _inner_fn # type: ignore

/opt/conda/lib/python3.7/site-packages/huggingface_hub/repository.py in __init__ (self, local_dir, clone_from, repo_type, token, git_user, git_email, revision, skip_lfs_files, client)
    516 
    517 if clone_from is not None:
--> 518 self.clone_from(repo_url=clone_from)
    519 else:
    520 if is_git_repo(self.local_dir):

/opt/conda/lib/python3.7/site-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
    122 )
    123 
--> 124 return fn(*args, **kwargs)
    125 
    126 return _inner_fn # type: ignore

/opt/conda/lib/python3.7/site-packages/huggingface_hub/repository.py in clone_from(self, repo_url, token)
    731 
    732 except subprocess.CalledProcessError as exc:
--> 733 raise EnvironmentError(exc.stderr)
    734 
    735 def git_config_username_and_email(

OSError: WARNING: 'git lfs clone' is deprecated and will not be updated
          with new flags from 'git clone'

'git clone' has been updated in upstream Git to have comparable
speeds to 'git lfs clone'.
Cloning into '.'...
remote: Repository not found
fatal: repository 'https://huggingface.co/mwitiderrick/catsdiffusion/' not found
Error(s) during clone:
git clone failed: exit status 128

```

---

<div class="post-metadata">

**Author:** ![williamberman](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/williamberman/32/14112_2.png) [@williamberman](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fwilliamberman)%5C
**Post date:** [March 9, 2023, 5:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%2F2 "2023-03-09T17:54:13Z")

</div>

This looks like there was an issue in your local git client talking to the hub. Could you try to pull the repository manually from the command line?

---

<div class="post-metadata">

**Author:** ![JennnDexter](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@JennnDexter](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJennnDexter)%5C
**Post date:** [June 7, 2023, 12:12am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%2F3 "2023-06-07T00:12:09Z")

</div>

Please kindly advise the way to overcome this issue, if someone knows.

---

<div class="post-metadata">

**Author:** ![JennnDexter](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@JennnDexter](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJennnDexter)%5C
**Post date:** [June 7, 2023, 1:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%2F4 "2023-06-07T13:43:04Z")

</div>

Thank you, but I overcome already.

---

<div class="post-metadata">

**Author:** ![myeonggyo](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@myeonggyo](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmyeonggyo)%5C
**Post date:** [August 9, 2023, 6:30am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%2F5 "2023-08-09T06:30:51Z")

</div>

how? i have same error.

---

<div class="post-metadata">

**Author:** ![sudooodus](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@sudooodus](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsudooodus)%5C
**Post date:** [September 25, 2023, 3:25pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%2F6 "2023-09-25T15:25:17Z")

</div>

Hello, I have the same error, how to solve it, thank you very much!

---

<div class="post-metadata">

**Author:** ![nghiadoan](https://avatars.discourse-cdn.com/v4/letter/n/aca169/32.png) [@nghiadoan](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnghiadoan)%5C
**Post date:** [October 1, 2023, 6:35pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%2F7 "2023-10-01T18:35:06Z")

</div>

I fixed this issue. Here is my method.  
-Go to last line of the error find what repo is not found.  
-Go to [Hugging Face – The AI community building the future.](https://huggingface.co/new) to create the repository that is missing  
-Run the code again

---

<div class="post-metadata">

**Author:** ![jgajardo](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@jgajardo](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjgajardo)%5C
**Post date:** [December 4, 2023, 7:26pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-lfs-error-on-training-diffusers%2F32465%2F8 "2023-12-04T19:26:55Z")

</div>

Setting push\_to\_hub=False in the config solved it for me
