rxtan2 / Learning-Similarity-Conditions

46 stars 15 forks source link

Error when running "python3 main.py --name experiment1 --learned --num_traintriplets 200000" #9

Open VickyPenkova opened 4 years ago

VickyPenkova commented 4 years ago
Traceback (most recent call last):
  File "main.py", line 361, in <module>
    main()
  File "main.py", line 166, in main
    train(train_loader, tnet, criterion, optimizer, epoch)
  File "main.py", line 197, in train
    dista, distb, mask_norm, embed_norm, mask_embed_norm = tnet(data1, data2, data3, c)
  File "/usr/local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/Users/vpenkova/Learning-Similarity-Conditions/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]
jackylin0316 commented 3 years ago

I also encountered the same problem, have you found a solution yet?

rxtan2 commented 3 years ago

Hey, I apologize for the slow reply. Please try running this on a single GPU and let me know if you are still running into this issue. Thanks!