h5py 데이터 세트에 데이터를 쓰려고하지만, 12MB GCE 인스턴스를 사용하여 SSD 디스크에 쓰기는하지만 실행합니다 시야에 끝이없는 13 시간 동안. 는 내가 SSD 디스크에 저장된 파일에 h5py 데이터 세트에 추가하기 전에 (제 2의 비 SSD 디스크에 저장) 작은 파일의 큰 숫자를 unpickle하는 GCE 인스턴스에서 Jupyter 노트북을 실행하는거야SSD 디스크의 h5py에 데이터 쓰기가 느리게 나타남 : 속도를 높이려면 어떻게해야합니까?
- 최대 형상 =
(29914, 251328)
- 덩어리 =
(59, 982)
- 압축 =
gzip
- DTYPE =
float64
내 코드는 디스크의 h5py 파일은 제가 위에서 아래 코드를 사용하여 웁니다있는 각 데이터 세트를 1.4GB를 높일 것으로 보인다
#Get a sample
minsample = 13300
sampleWithOutReplacement = random.sample(ListOfPickles,minsample)
print(h5pyfile)
with h5py.File(h5pyfile, 'r+') as hf:
GroupToStore = hf.get('group')
DatasetToStore = GroupToStore.get('ds1')
#Unpickle the contents and add in th h5py file
for idx,files in enumerate(sampleWithOutReplacement):
#Sample the minimum number of examples
time FilePath = os.path.join(SourceOfPickles,files)
#Use this method to auto close the file
with open(FilePath,"rb") as f:
%time DatasetToStore[idx:] = pickle.load(f)
#print("Processing file ",idx)
print("File Closed")
아래에 나열된 것은 h5py 파일
group.create_dataset(labels, dtype='float64',shape= (maxSize, 251328),maxshape=(maxSize,251328),compression="gzip")
의 데이터 세트를 생성하려면 코드입니다 h5py 파일을 채우는 데 필요한 시간을 줄이기 위해 구성이나 코드 또는 둘 모두를 개선 할 수 있습니까?
업데이트 1 은 내가 8hrs
CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 14.1 µs
CPU times: user 8h 4min 11s, sys: 1min 18s, total: 8h 5min 30s
Wall time: 8h 5min 29s