I am using google colab to execute the program. Pythoon veersion is 3.10.11 !pip install syft==0.8.0.post2 hook = sy.TorchHook(torch) but showing AttributeError: module 'syft' has no attribute 'TorchHook'

!pip install syft==0.8.0.post2 hook = sy.TorchHook(torch) but showing AttributeError: module 'syft' has no attribute 'TorchHook' Please fix the problem regarding syft==0.8.0.post2

2

There are 2 best solutions below

3
Ilinii On

sy.TorchHook() has been deprecated since the release of PySyft 0.3.0. It is not needed anymore to create VirtualWorkers or execute any other functions.

In general you can directly write :

import syft as sy
client = sy.virtualWorker(id="client")
0
Saqr Thabet On

So far, I checked and I found that there are no VirtualWorker nor VirtualMachine attributes but Worker. Which we have to give it a name not id. For example, bob=sy.Worker(name='bob'). Furthermore, to check the value stored print(bob._objects) is no longer working but print(bob.client_cache). At the same time, after establishing a new tensor variable, there are no attributes such as send() and get(), which means there must be another way to send and receive tensor values over Pysyft based clients.