【问题标题】:Trying to push large TensorFlow model to GitHub repo using GitHub's Large File Storage尝试使用 GitHub 的大文件存储将大型 TensorFlow 模型推送到 GitHub 存储库
【发布时间】:2026-01-19 13:55:01
【问题描述】:

我有一个大型 TensorFlow 模型,我想将其推送到 GitHub 存储库。该文件超过了 GitHub 的 100MB 大小限制。

我正在尝试使用 Git Large File Storage,运行以下命令:

brew install git-lfs

git lfs track "*.zip"

git lfs track "*.json"

git lfs track "*.h5"

git add .gitattributes

git add .

git commit -m 'adding git large file storage'

git push origin master

...但我仍然收到以下错误

remote: error: File my_big_model.zip is 235.37 MB; this exceeds GitHub's file size limit of 100.00 MB remote: error: File tf_model.h5 is 255.54 MB; this exceeds GitHub's file size limit of 100.00 MB remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. ! [remote rejected] master -> master (pre-receive hook declined)

我在 GitPod 内部运行它。

【问题讨论】:

    标签: tensorflow github large-files gitpod


    【解决方案1】:

    你需要做的

    git lfs push --all origin master
    

    git push origin master 之前。您在这里所做的是,将文件推送到 LFS 并将指针推送到 GitHub。 这可能会有所帮助:Where are git-lfs files stored?

    【讨论】: