Closed zhenxing-li closed 1 year ago
Hi Zhenxing, do you mind trying to run the code on a single GPU and see if you are still getting the same result?
Traceback (most recent call last): File "D:/LZX/Learning-Similarity-Conditions-master/main.py", line 361, in main() File "D:/LZX/Learning-Similarity-Conditions-master/main.py", line 166, in main train(train_loader, tnet, criterion, optimizer, epoch) File "D:/LZX/Learning-Similarity-Conditions-master/main.py", line 197, in train dista, distb, mask_norm, embed_norm, mask_embed_norm = tnet(data1, data2, data3, c) File "D:\anaconda\envs\TF2.1\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "D:\LZX\Learning-Similarity-Conditions-master\tripletnet.py", line 36, in forward general_x = general_x / norm.expand_as(general_x) RuntimeError: The expanded size of the tensor (64) must match the existing size (96) at non-singleton dimension 1. Target sizes: [96, 64]. Tensor sizes: [96]
Process finished with exit code 1
I have the same problem with you. Did yo solve it? Thank you
Traceback (most recent call last): File "D:/LZX/Learning-Similarity-Conditions-master/main.py", line 361, in
main()
File "D:/LZX/Learning-Similarity-Conditions-master/main.py", line 166, in main train(train_loader, tnet, criterion, optimizer, epoch) File "D:/LZX/Learning-Similarity-Conditions-master/main.py", line 197, in train dista, distb, mask_norm, embed_norm, mask_embed_norm = tnet(data1, data2, data3, c) File "D:\anaconda\envs\TF2.1\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "D:\LZX\Learning-Similarity-Conditions-master\tripletnet.py", line 36, in forward general_x = general_x / norm.expand_as(general_x) RuntimeError: The expanded size of the tensor (64) must match the existing size (96) at non-singleton dimension 1. Target sizes: [96, 64]. Tensor sizes: [96]
Process finished with exit code 1