Как импортировать данные из корзины S3 в Sagemaker AWS? - PullRequest
0 голосов
/ 09 апреля 2020

Импорт файлов для создания обучающих данных

transformed_dataset = FacialKeypointsDataset(csv_file='s3://mybucket/newData/out2.csv',
                                             root_dir='s3://mybucket/newData/training/images/',
                                             transform=data_transform)


print('Number of images: ', len(transformed_dataset))


# iterate through the transformed dataset and print some stats about the first few samples
for i in range(4):
    sample = transformed_dataset[i]
    print(i, sample['image'].size(), sample['keypoints'].size())

Сообщение об ошибке

--------------------------------------------------------------------------- URLError Traceback (most recent call last) <ipython-input-34-82aba972e27c> in <module> 8 # iterate through the transformed dataset and print some stats about the first few samples 9 for i in range(4): ---> 10 sample = transformed_dataset[i] 11 print(i, sample['image'].size(), sample['keypoints'].size()) ~/data_load.py in __getitem__(self, idx) 28 self.key_pts_frame['#filename'][idx]) 29 ---> 30 image = mpimg.imread(image_name) 31 32 # if image has an alpha color channel, get rid of it /opt/conda/lib/python3.6/site-packages/matplotlib/image.py in imread(fname, format) 1428 if len(parsed.scheme) > 1: 1429 from urllib import request -> 1430 fd = BytesIO(request.urlopen(fname).read()) 1431 return handler(fd) 1432 else: /opt/conda/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context) 221 else: 222 opener = _opener --> 223 return opener.open(url, data, timeout) 224 225 def install_opener(opener): /opt/conda/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout) 524 req = meth(req) 525 --> 526 response = self._open(req, data) 527 528 # post-process response /opt/conda/lib/python3.6/urllib/request.py in _open(self, req, data) 547 548 return self._call_chain(self.handle_open, 'unknown', --> 549 'unknown_open', req) 550 551 def error(self, proto, *args): /opt/conda/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args) 502 for handler in handlers: 503 func = getattr(handler, meth_name) --> 504 result = func(*args) 505 if result is not None: 506 return result /opt/conda/lib/python3.6/urllib/request.py in unknown_open(self, req) 1386 def unknown_open(self, req): 1387 type = req.type -> 1388 raise URLError('unknown url type: %s' % type) 1389 1390 def parse_keqv_list(l): URLError: <urlopen error unknown url type: s3>

Итак, у меня есть корзина S3 с метками изображений и ключевых точек, я пытаюсь импортировать данные s3 в блокнот sagemaker. У меня есть обучающая папка с обучающими изображениями в newData, а out2.csv имеет метку

Может ли кто-нибудь помочь мне с этим?

...