データをh5pyデータセットに書き込もうとしていますが、高メモリ12コアのGCEインスタンスを使用してSSDディスクに書き込みます13時間、目の前に終わりがない。 私はSSDのディスク上に格納されたファイルにh5pyデータセットに追加する前に(第二非SSDディスクに格納されている)小さな多数のファイルをunpickle化するGCEインスタンス上Jupyterノートブックを実行しているSSDディスクのh5pyにデータを書き込むのが遅い:速度を上げるためにできること
- 最大形状=
(29914, 251328)
- チャンク=
- 圧縮=
gzip
- DTYPE =
float64
(59, 982)
私のコードは、ディスク上のh5pyファイルは、私が上記および下記のコードを使用して移入各データセットを1.4ギガバイトを増やしているようだ
#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 は私が8時間
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