Based on the error message you are trying to index a tensor or numpy array in 2 dimensions, while the object has only a single one.
I would recommend to check the shapes of all tensors/arrays in the line of code which throws this error and fix the indexing. Maybe you are already slicing the object before and thus removing one dimension?