Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mrmrn opened this issue May 24, 2018 · 0 comments
Open

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

mrmrn opened this issue May 24, 2018 · 0 comments

Comments

@mrmrn
Copy link

mrmrn commented May 24, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant