jacobgil / pytorch-tensor-decompositions

PyTorch implementation of [1412.6553] and [1511.06530] tensor decomposition methods for convolutional layers.
https://jacobgil.github.io/deeplearning/tensor-decompositions-deep-learning
279 stars 63 forks source link

error in cp decomposition #5

Closed chaow94 closed 4 years ago

chaow94 commented 4 years ago

Sir, I follow your instruction to decompose models.

I decompose model using

python main.py --decompose --cp

However I got error as following:

Traceback (most recent call last): File "main.py", line 138, in decomposed = cp_decomposition_conv_layer(conv_layer, rank) File "/home/workspace/pytorch-tensor-decompositions/decompositions.py", line 14, in cp_decomposition_conv_layer parafac(layer.weight.data, rank=rank, init='svd') ValueError: not enough values to unpack (expected 4, got 2)

I thought tensoly api was changed and what's version is suitable for this repo? any advice? Thanks a lot.

chaow94 commented 4 years ago

It works on pytorch 1.10 and tensorly 0.4.0.

sxdnbnb commented 1 year ago

I use pytorch 1.10 and tensorly 0.4.0.,but I got error as following: File "/content/drive/MyDrive/Tensor_decomposing/decompositions.py", line 14, in cp_decomposition_conv_layer parafac(layer.weight.data, rank=rank, init='svd') File "/usr/local/lib/python3.9/dist-packages/tensorly/decomposition/candecomp_parafac.py", line 153, in parafac factor = T.transpose(T.solve(T.transpose(pseudo_inverse), T.transpose(factor))) File "/usr/local/lib/python3.9/dist-packages/tensorly/backend/pytorchbackend.py", line 152, in solve solution, = torch.gesv(matrix2, matrix1) AttributeError: module 'torch' has no attribute 'gesv'