0
이미지를 hdf5 파일에 넣기 전에 셔플하고 싶지만 계산에 오류가 있습니다. 최근의 학습자로서 hdf5 문서를 읽는 것조차도 알 수 없습니다. 친절하게 안내 해줍니다.이미지를 hdf5 파일로 셔플 처리하는 중
from random import shuffle
import glob
shuffle_data = True # shuffle the addresses before saving
hdf5_path = 'Cat vs Dog/dataset.hdf5' # address to where you want to save the hdf5 file
cat_dog_train_path = 'Cat vs Dog/train/*.jpg'
# read addresses and labels from the 'train' folder
addrs = glob.glob(cat_dog_train_path)
labels = [0 if 'cat' in addr else 1 for addr in addrs] # 0 = Cat, 1 = Dog
# to shuffle data
if shuffle_data:
c = list(zip(addrs, labels))
shuffle(c)
addrs, labels = zip(*c)
오류 :
> ValueError Traceback (most recent call
> last) <ipython-input-19-4408536403db> in <module>()
> 2 c = list(zip(address, labels))
> 3 shuffle(c)
> ----> 4 addrs, labels = zip(*c)
>
> ValueError: not enough values to unpack (expected 2, got 0)
참조 : http://machinelearninguru.com/deep_learning/data_preparation/hdf5/hdf5.html#list