rxtan2 / Learning-Similarity-Conditions

46 stars 15 forks source link

code #13

Open TYZXD opened 2 years ago

TYZXD commented 2 years ago
general_x = general_x / norm.expand_as(general_x)

RuntimeError: The expanded size of the tensor (64) must match the existing size (32) at non-singleton dimension 1. Target sizes: [32, 64]. Tensor sizes: [32] if I change torch.norm(keepdim= True), the code can run. but the accuracy is still 60%, not 90%. Have anyone solve this problem, thanks a lot.

rxtan2 commented 1 year ago

Hi TYZXD,

I am really sorry for missing this. Please do not hesitate to email me so that I do not miss your question. May I clarify if this is on the zappos dataset as well as the torch version that you are using? I think there are a few incompatibility issues with the newer versions. Also, can you try checking the values of the computed norm to see if the tensor is expanded in the right way? Thank you!