Skip to content

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed #28

@rouchoo

Description

@rouchoo

hi, Dr Hu. Recently, I have been tried to run your Topoloss.py in my own network.

The shape of input tensor is [4, 2, 512, 512], and the shape of label tensor is [4, 512, 512]. I want to traverse four images in a batch and calculate their average loss, so I wrote the following code:
image

At the beginning, i can successfully run the code while the speed was very slow (because it had to be calculated on the CPU).
Later, during the 14000 iteration, it suddenly reported the following error:
image

I guess it should be resulted by the certain image calculated homology features only have 0-dimension (points) and not have 1-dimension (loops).

Can you give me some guidance? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions