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

Lesson 7. Trusted Aggregator issue: set_storage is not allowed on Tensor created from .data or .detach() #13

Open
RansSelected opened this issue Jul 16, 2019 · 2 comments

Comments

@RansSelected
Copy link

RansSelected commented Jul 16, 2019

Hi!
I followed the "Project Demo Federated Learning with Trusted Aggregator" video in Lesson 7. It appears to be a problem with this part of the code
model.weight.data.set_(((alices_model.weight.data + bobs_model.weight.data) / 2).get()) cause it reise an error:
RuntimeError: set_storage is not allowed on Tensor created from .data or .detach()

At the same time ((alices_model.weight.data + bobs_model.weight.data) / 2).get() provide a normal tensor as an output.

How is it possible to solve this issue?

Characteristics of my environment:

  • Python 3.7.3

  • Torch 1.1.0.post2

  • Syft 0.1.21a1

  • Jupyter notebook

  • MacOS Mojave 10.14.5

@enaymerich
Copy link

I've seen that this is due to an update in pytorch:
here a post on the update
pytorch/pytorch#15070
here a similar issue with in-place op
microsoft/NeuronBlocks#13
I personally had the same problem, and I think I solved by assigning to model.weight.data the weigths like this:
model.weight.data = ((alices_model.weight.data + bobs_model.weight.data) / 2).get()

@danielpesa7
Copy link

Same problem here, thanks @enaymerich for the solution, it totally worked.

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

3 participants