muzic icon indicating copy to clipboard operation
muzic copied to clipboard

An error about 'norm'

Open Kevinzhang027 opened this issue 2 years ago • 2 comments

100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 35.00it/s] Traceback (most recent call last): File "/Users/kevinzhang/muzic/clamp/clamp.py", line 292, in values = compute_values(query_feature, key_features) File "/Users/kevinzhang/muzic/clamp/clamp.py", line 58, in compute_values K_e = torch.nn.functional.normalize(K_e, dim=1) File "/Users/kevinzhang/opt/anaconda3/lib/python3.9/site-packages/torch/nn/functional.py", line 4632, in normalize denom = input.norm(p, dim, keepdim=True).clamp_min(eps).expand_as(input) AttributeError: 'list' object has no attribute 'norm'

Kevinzhang027 avatar May 19 '23 06:05 Kevinzhang027

Please review the key_features being used in the compute_values() function on line 291. This variable should be obtained from the get_features() function on line 265 and should be a torch.tensor instead of a list.

sander-wood avatar May 28 '23 04:05 sander-wood

I encountered the same error because I didn't unzip the music_keys.zip file, which caused key_features to be an empty list instead of a torch.tensor. Therefore, you can check if you have unzipped this file.

heyingquan0030 avatar Mar 28 '24 15:03 heyingquan0030