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

About example file&loss_landscape with GPU support #3

Open
mountains-high opened this issue Jun 11, 2022 · 0 comments
Open

About example file&loss_landscape with GPU support #3

mountains-high opened this issue Jun 11, 2022 · 0 comments

Comments

@mountains-high
Copy link

Hello!

Thank you for your fine work.
I wanted to reproduce the same experiments as shown in the example file.
But I got this error message while plotting loss_landscapes of original and pruned weights.
Could you help me please to use GPU? Thank you

 File "p.py", line 76, in <module>
    loss_data_fin = loss_landscapes.random_plane(model_final, metric, 1, STEPS, normalization='filter', deepcopy_model=True)
  File "/home/user/Desktop/loss_landscapes/main.py", line 285, in random_plane
    dir_one.filter_normalize_(start_point)
  File "/home/user/Desktop/loss_landscapes/model_interface/model_parameters.py", line 226, in filter_normalize_
    self.parameters[l] *= (ref_point.parameters[l].norm(order) / self.parameters[l].norm(order))
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
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