0

我正在通过使用 fastai 的讲座来学习深度学习。我在 AWS p2.xlarge 上运行 fastai 库。当我在 fastai 库上运行某些函数时,出现此错误。:

Traceback (most recent call last)
<ipython-input-12-1d86fc0ece07> in <module>()
       1 arch = resnet34
       2 data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch,sz ))
 ----> 3 learn = ConvLearner.pretrained(arch, data, precompute = True)
       4 learn.fit(0.01, 2)

~/fastai/fastai/conv_learner.py in pretrained(cls, f, data, ps, xtra_fc, xtra_cut, custom_head, precompute, pretrained, **kwargs)
112         models = ConvnetBuilder(f, data.c, data.is_multi, data.is_reg,
113             ps=ps, xtra_fc=xtra_fc, xtra_cut=xtra_cut, custom_head=custom_head, pretrained=pretrained)
 --> 114         return cls(data, models, precompute, **kwargs)
    115 
    116     @classmethod

 ~/fastai/fastai/conv_learner.py in __init__(self, data, models,     precompute, **kwargs)
 95     def __init__(self, data, models, precompute=False, **kwargs):
 96         self.precompute = False
 ---> 97         super().__init__(data, models, **kwargs)
 98         if hasattr(data, 'is_multi') and not data.is_reg and self.metrics is None:
 99             self.metrics = [accuracy_thresh(0.5)] if self.data.is_multi else [accuracy]

 ~/fastai/fastai/learner.py in __init__(self, data, models, opt_fn, tmp_name, models_name, metrics, clip, crit)
 35         self.tmp_path = tmp_name if os.path.isabs(tmp_name) else os.path.join(self.data.path, tmp_name)
 36         self.models_path = models_name if os.path.isabs(models_name) else os.path.join(self.data.path, models_name)
---> 37         os.makedirs(self.tmp_path, exist_ok=True)
 38         os.makedirs(self.models_path, exist_ok=True)
 39         self.crit = crit if crit else self._get_crit(data)

 ~/anaconda3/envs/fastai/lib/python3.6/os.py in makedirs(name, mode, exist_ok)
218             return
219     try:
--> 220         mkdir(name, mode)
221     except OSError:
222         # Cannot rely on checking for EEXIST, since the operating system

PermissionError: [Errno 13] Permission denied: 'data/dogscats/tmp'

我认为 AWS 控制台无权创建目录。我做到了sudo mkdir tmp data/dogscats/,但我得到了另一个我无法理解的错误。

我想我必须给 AWS 一些许可,但我不知道该怎么做。

我希望你们能给我一些关于如何解决这类问题的清晰想法。

4

1 回答 1

0

Fastai 创建的数据保存在它创建的文件夹中,例如当前丢失等。默认情况下,该文件夹是在工作目录中创建的,但您可以传递参数path,即您有权创建文件夹的路径。

于 2019-05-11T17:11:35.367 回答