Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from zydou/pytorch0.3
Support for pytorch v0.3
- Loading branch information
3293ca7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this add support for Pytorch v0.3? Did you merge wrong commits?
AFAIK to support Pytorch v0.3, you need to remove
keepdim
argument fromtorch.sum()
, but I'm not sure how that interacts with v0.2.3293ca7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @Rizhiy
Running the code before this commit under pytorch0.3 will raise errors:
After import these packages explicitly in
open-reid/reid/utils/data/transforms.py
, the code works again.3293ca7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @Rizhiy
I checked the pytorch 0.3 docs and found that the
keepdim
argument is still remained intorch.sum(), torch.mean(), torch.max(), torch.min(), etc.
Please see here
3293ca7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm an idiot. I think I have been using the old pytorch all this time since conda installs it by default.
My mistake.
3293ca7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, the following problem appears in my code: My environment is pytorch0.4
Traceback (most recent call last):
File "F:/MyDownloads/open-reid-master/open-reid-master/examples/softmax_loss.py", line 217, in
main(parser.parse_args())
File "F:/MyDownloads/open-reid-master/open-reid-master/examples/softmax_loss.py", line 104, in main
metric = DistanceMetric(algorithm=args.dist_metric)
File "F:\MyDownloads\open-reid-master\open-reid-master\reid\dist_metric.py", line 13, in init
self.metric = get_metric(self.algorithm, *args, **kwargs)
File "F:\MyDownloads\open-reid-master\open-reid-master\reid\metric_learning_init_.py", line 25, in get_metric
return __factory[algorithm](*args, **kwargs)
TypeError: Can't instantiate abstract class Euclidean with abstract methods get_metric, score_pairs