Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and run git lfs install followed by git lfs pull in the folder you cloned. #133

Open
catnomice opened this issue Apr 22, 2024 · 4 comments

Comments

@catnomice
Copy link

报错如下:
Traceback (most recent call last):
File "C:\Users\username\anaconda3\envs\aniPortrait\lib\site-packages\diffusers\models\modeling_utils.py", line 109, in load_state_dict
return torch.load(checkpoint_file, map_location="cpu")
File "C:\Users\username\anaconda3\envs\aniPortrait\lib\site-packages\torch\serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\username\anaconda3\envs\aniPortrait\lib\site-packages\torch\serialization.py", line 1033, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\username\anaconda3\envs\aniPortrait\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\username\anaconda3\envs\aniPortrait\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\AniPortrait-main\AniPortrait\scripts\audio2vid.py", line 268, in
main()
File "D:\AniPortrait-main\AniPortrait\scripts\audio2vid.py", line 78, in main
reference_unet = UNet2DConditionModel.from_pretrained(
File "C:\Users\username\anaconda3\envs\aniPortrait\lib\site-packages\diffusers\models\modeling_utils.py", line 800, in from_pretrained
state_dict = load_state_dict(model_file, variant=variant)
File "C:\Users\username\anaconda3\envs\aniPortrait\lib\site-packages\diffusers\models\modeling_utils.py", line 116, in load_state_dict
raise OSError(
OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and run git lfs install followed by git lfs pull in the folder you cloned.
我使用anaconda3在windows11系统上尝试部署此项目,当我安装完成requirement.txt后,我尝试运行该项目,结果一个我无法解决的报错发生了。
从字面意思上看,这似乎意味着我应该使用git lfs工具管理以上.py文件,但是我尝试了安装git lfs、重新clone项目、再次安装requirement.txt、追踪“*.py”文件后,依旧无法成功运行git lfs pull命令,它在一行空白后直接终止了运行,没有任何反馈,如下图:
image
与此相对的,git lfs install、git lfs --version命令看起来运行得很好。
我注意到,该项目似乎并未包含.gitattributes项目,这是否意味着git lfs并不是该项目所必需的?那么这个报错是什么原因引发的?源自预训练模型?
我该怎么解决这个报错?

@Zejun-Yang
Copy link
Owner

报错发生在加载模型权重的位置。运行代码前需要手动下载我们的模型权重以及其他依赖模型,具体可参考https://github.com/Zejun-Yang/AniPortrait?tab=readme-ov-file#download-weights

@catnomice
Copy link
Author

在该问题发生时我已经下载并组织了模型
屏幕截图_20240422_140903
所以说我不能将他们直接下载下来再拷贝到文件中去?对不起但我想知道这应该如何解决,毕竟这是一个11G大小的文件夹

@Zejun-Yang
Copy link
Owner

Zejun-Yang commented Apr 22, 2024

为了确保代码顺利运行,请完整下载stable-diffusion-v1-5并拷贝到pretrained_model路径下。如果内存不足,您也可以根据代码实际调用文件情况,删除该文件夹下非必要的参数文件。

Please download all the pre-trained model files according to README.
So that you can address the model loading issue.
Also, the command of 'git lfs pull' is used to download large file from github or huggingface.

@catnomice
Copy link
Author

所有预训练模型都需要完整下载下来,并且经过改名后直接放入pretrained_model路径下,对吗?这是否意味着我不能删除那些在列表中未出现的文件?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants