if not os.path.exists(source_path):
raise IOError("Directory does not exist: {0}".format(source_path))
if not os.path.exists(dest_path):
os.mkdir(dest_path)
num = int(num)
img_element_array = []
sample_array = []
num_images = []
After Change
if not os.path.exists(source_path):
raise IOError("Directory does not exist: {0}".format(source_path))
os.makedirs(dest_path, exist_ok=True)//python >=3.2
img_element_array = []
sample_array = []