kaggle notebook中使用git lfs

#爲kaggle notebook配置git-lfs
!curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh |  bash
!apt-get install -y --allow-unauthenticated git-lfs

 

# 下面是依賴包
!pip install pretrainedmodels
!pip install albumentations==0.3.0
!pip install addict
!rm -r RSNA666
!git clone https://github.com/appleyuchi/RSNA_kaggle_notebook

!cp /kaggle/input/cache666/*.pkl /kaggle/working/RSNA_kaggle_notebook/cache
!cd /kaggle/working/RSNA666;ls -l
!git clone https://github.com/NVIDIA/apex && cd apex && pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

 

#假定我們要保存的大文件是.pt權重,那麼我們假設保存在

www.github.com/appleyuchi/appleyuchi/RSNA_MODEL中:

如下:

 

!rm -r  /kaggle/working/RSNA_MODEL
!git clone https://github.com/appleyuchi/RSNA_MODEL
!cp /kaggle/working/*.pt /kaggle/working/RSNA_MODEL
!cd /kaggle/working/RSNA_MODEL/;git lfs track "*.pt";git add .gitattributes;git add *.pt
!cd /kaggle/working/RSNA_MODEL/;git status
!cd /kaggle/working/RSNA_MODEL;git commit --allow-empty-message -m f''&&git push https://appleyuchi:密碼@github.com/appleyuchi/RSNA_MODEL.git --all

 

 

銷燬git上面的.pt模型文件(必須kaggle上操作,因爲我們是國內,github服務器是國外,我們不能在自己電腦上進行銷燬模型操作):

!git clone https://github.com/appleyuchi/RSNA_MODEL
!cd /kaggle/working/RSNA_MODEL;rm *.pt;git add *;git commit --allow-empty-message -m f''&&git push https://appleyuchi:密碼@github.com/appleyuchi/RSNA_MODEL.git --all

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值