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

[BUG] run HSAN on cpu/cuda #8

Open
habaneraa opened this issue Oct 12, 2023 · 0 comments
Open

[BUG] run HSAN on cpu/cuda #8

habaneraa opened this issue Oct 12, 2023 · 0 comments

Comments

@habaneraa
Copy link

I tried to run HSAN on cpu ( args.device is "cpu") but an exception was raised.

I noticed that .cuda() methods are called on the pytorch tensors pos_weight/pos_neg_weight when creating HardSampleAwareNetwork instance. All tensors should respect the args.device and all model parameters should be moved as a whole between CPU and GPU. PyTorch would move all registered parameters when .to(device) is called on a module. So I think maybe we should treat pos_weight/pos_neg_weight as parameters of the HSAN module.

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

1 participant