在AWS设置上使用Fastai库时保持拒绝获得权限

时间:2018-08-29 10:42:13

标签: amazon-web-services permission-denied fast-ai

我通过参加使用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一些许可,但是我不知道如何做到这一点。

我希望你们能给我一些明确的思路,以解决这种问题。

1 个答案:

答案 0 :(得分:0)

Fastai在默认情况下会在其创建的文件夹中创建保存数据(例如电流损耗等),该文件夹是在工作目录中创建的,但是您可以传递参数path,这是您有权创建文件的路径。文件夹。