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

【问题】Google Colab环境问题 #3

Open
zhouqihong opened this issue May 12, 2019 · 3 comments
Open

【问题】Google Colab环境问题 #3

zhouqihong opened this issue May 12, 2019 · 3 comments
Labels
问题求助 学习过程中遇到的问题
Milestone

Comments

@zhouqihong
Copy link

No description provided.

@wqw547243068
Copy link
Owner

wqw547243068 commented May 12, 2019

(1)参考这篇博客,里面有这节课的图片下载代码

folder = 'teddys'
file = 'urls_teddys.txt'
path = Path('data/bears')
dest = path/folder
dest.mkdir(parents=True, exist_ok=True)

download_images(path/file, dest, max_pics=200)

# 如果下载出现问题,uncomment下列代码查看
# download_images(path/file, dest, max_pics=20, max_workers=0)

(2)去fastai源代码里找image_download的定义
(3)fastai官网类似帖子
来自fastai中文笔记
Step 4: Saving your data files
如果你希望改写你的文件,你需要允许你的Colaboratory instance读取和改写你的 Google Drive. 你只需要在每一个notebook的第一个Cell中写入以下代码

from google.colab import drive
drive.mount('/content/gdrive', force_remount=True)
root_dir = "/content/gdrive/My Drive/"
base_dir = root_dir + 'fastai-v3/'

现在,Google Drive 变成了一个文件系统允许标准python读写文件. 不要忘记给所有notebook的根目录地址前加上 base_dir . 例如, 在 lesson2-download.ipynb 5th cell, 做一下修改

path = Path(base_dir + 'data/bears')
dest = path/folder
dest.mkdir(parents=True, exist_ok=True)

@wqw547243068 wqw547243068 changed the title 如何下载图片 【第二课】colab里如何下载图片 May 13, 2019
@zhouqihong
Copy link
Author

zhouqihong commented May 13, 2019 via email

@wqw547243068
Copy link
Owner

wqw547243068 commented May 13, 2019

不一定管用,上面是从drive里读数据,好像跟你的不一样,必要的话,把那你的代码贴出来

@wqw547243068 wqw547243068 added the 问题求助 学习过程中遇到的问题 label May 14, 2019
@wqw547243068 wqw547243068 changed the title 【第二课】colab里如何下载图片 【问题】colab里如何下载图片 May 17, 2019
@wqw547243068 wqw547243068 added this to the Fast.AI入门须知 milestone May 17, 2019
@wqw547243068 wqw547243068 changed the title 【问题】colab里如何下载图片 【问题】Google Colab环境问题 May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
问题求助 学习过程中遇到的问题
Projects
None yet
Development

No branches or pull requests

2 participants