taspinar / sidl

Deep Learning code
MIT License
59 stars 52 forks source link

index 5655 is out of bounds for axis 1 with size 0 #3

Open mrmrn opened 6 years ago

mrmrn commented 6 years ago

hi. I read your blog post and its really amazing for me. I have an error in section 4.1 Preparing a training, test and validation dataset. and as you see my stats bellow is different with your in notenook:

There are 4069 tiles containing

this is my outputs:

There are 5701 tiles containing roads.
Of roadtype P (Provincie) there are 47 tiles.
Of roadtype G (Gemeente) there are 4946 tiles.
Of roadtype W (Waterschap) there are 902 tiles.
Of roadtype T (Andere wegbeheerder) there are 1 tiles.
Randomizing dataset...
Traceback (most recent call last):
  File "stats.py", line 227, in <module>
    dataset, labels_roadpresence, labels_roadtype_ohe, labels_filename = reformat_data(dataset, labels_roadpresence, labels_roadtype_ohe, labels_filename)
  File "stats.py", line 184, in reformat_data
    dataset, labels1, labels2, labels3 = randomize(dataset, labels1, labels2, labels3)
  File "stats.py", line 176, in randomize
    randomized_labels2 = labels2[permutation]
IndexError: index 5655 is out of bounds for axis 1 with size 0

the lines error log pointed is:

def randomize(dataset, labels1, labels2, labels3):
    permutation = np.random.permutation(dataset.shape[0])
    randomized_dataset = dataset[permutation, :, :, :]
    randomized_labels1 = labels1[permutation]
    randomized_labels2 = labels2[permutation]
    randomized_labels3 = labels3[permutation]

and dataset, labels_roadpresence, labels_roadtype_ohe, labels_filename = reformat_data(dataset, labels_roadpresence, labels_roadtype_ohe, labels_filename)

what can I do for next chapter?