SegAnyGAussians
SegAnyGAussians copied to clipboard
Why this is infinite loop?
I encounters infinite loop when i run a saga_gui.py
First, the torch version caused the following error in def pca.
TypeError: linalg_eig() got an unexpected keyword argument 'eigenvectors'
So I changed it to the code below and the gui screen doesn't pop up when I run it and it's stuck in loading model file done.
`
def pca(self, X, n_components=3):
n = X.shape[0]
mean = torch.mean(X, dim=0)
X = X - mean
covariance_matrix = (1/n) * torch.matmul(X.T, X).float()
eigenvalues, eigenvectors = torch.linalg.eig(covariance_matrix)
# Convert complex eigenvalues and eigenvectors to real parts
eigenvalues = eigenvalues.real
eigenvectors = eigenvectors.real
# Sort eigenvectors based on eigenvalues in descending order
idx = torch.argsort(-eigenvalues)
eigenvectors = eigenvectors[:, idx]
proj_mat = eigenvectors[:, :n_components]
return proj_mat
`
Why is this like that?