Write out file with google colab

前端 未结 2 670
时光取名叫无心
时光取名叫无心 2021-02-07 07:54

Was there a way to write out files with google colab? For example, if I use

import requests
r = requests.get(url)

Where will those files be sto

2条回答
  •  孤街浪徒
    2021-02-07 08:50

    In your first example, the data is still in r.content. So you also need to save them first with open('data.dat', 'wb').write(r.content)

    Then you can download them with files.download

    from google.colab import files
    files.download('data.dat')
    

    Downloading your model is the same:

    files.download('my_model.ckpt')
    

提交回复
热议问题