Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diminsion miss match error while implimenting tripletloss #8

Closed
ssbilakeri opened this issue Dec 10, 2020 · 3 comments
Closed

diminsion miss match error while implimenting tripletloss #8

ssbilakeri opened this issue Dec 10, 2020 · 3 comments

Comments

@ssbilakeri
Copy link

Im getting bellow error. is this due to pytorch version ?
please clarify me

"main", fname, loader, pkg_name)
File "/home/padmashree/anaconda3/envs/myenv/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/padmashree/project_dir/EANet2/package/optim/eanet_trainer.py", line 135, in
trainer.train_phases()
File "/home/padmashree/project_dir/EANet2/package/optim/eanet_trainer.py", line 126, in train_phases
self.train()
File "package/optim/reid_trainer.py", line 338, in train
self.trainer.train_one_epoch(trial_run_steps=3 if cfg.trial_run else None)
File "package/optim/trainer.py", line 36, in train_one_epoch
self.train_one_step(batch)
File "package/optim/trainer.py", line 24, in train_one_step
pred = self.train_forward(batch)
File "/home/padmashree/project_dir/EANet2/package/optim/eanet_trainer.py", line 102, in train_forward
loss += self.loss_funcs[loss_cfg.name](reid_batch, pred, step=self.trainer.current_step)['loss']
File "package/loss/triplet_loss.py", line 124, in call
res3 = self.calculate(torch.stack(pred['feat_list']), batch['label'], hard_type=hard_type)
File "package/loss/triplet_loss.py", line 107, in calculate
dist_mat = compute_dist(feat, feat, dist_type=cfg.dist_type)
File "package/eval/torch_distance.py", line 49, in compute_dist
dist = euclidean_dist(array1, array2)
File "package/eval/torch_distance.py", line 25, in euclidean_dist
xx = torch.pow(x, 2).sum(1, keepdim=True).expand(m, n)
RuntimeError: expand(torch.cuda.FloatTensor{[9, 1, 256]}, size=[9, 9]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3)

@ptrblck
Copy link
Owner

ptrblck commented Dec 10, 2020

Which script/method from this repository are you using?

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 11, 2020 via email

@ptrblck
Copy link
Owner

ptrblck commented Dec 11, 2020

Thanks for the information. Would you mind creating a post in the forum with your question?
Closing this issue as it's unrelated to the repository.

@ptrblck ptrblck closed this as completed Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants