upload files from kaggle to google drive

后端 未结 2 1174
清酒与你
清酒与你 2021-01-27 04:02

I am using kaggle to train a model and once training is done I would like upload the trained model to google drive as I cant figure out a way to download the model locally. I lo

2条回答
  •  半阙折子戏
    2021-01-27 04:51

    I was trying to do the same: to save my kaggle model to google drive.

    When you call gauth.Authorize(), the gauth object is looking for a valid 'gauth.credentials".

    Instead of using "gauth.credentials = GoogleCredentials.get_application_default()", I'm using:

    # Try to load saved client credentials
    gauth = GoogleAuth()
    credential_file = 'gdrive.json'
    gauth.LoadCredentialsFile(credential_file)
    

    The credential file is created at your local computer by:

    gauth = GoogleAuth()
    credential_file = 'gdrive.json'
    gauth.LocalWebserverAuth()
    gauth.SaveCredentialsFile(credential_file)
    

    After getting the the credential file, upload it to kaggle then you can use it in your session.

    The credential will expire but I tried my kaggle session after 8 hours and it's still working.

    Checking the expire time using:

    gauth.credentials.token_expiry
    

提交回复
热议问题