AttributeError:模块“syft”没有属性“TorchHook”

Sha*_*lam 1 python encryption pysyft

请向专家寻求帮助:当我在 python 中使用 pysyft 库时,出现此错误( AttributeError: module 'syft' has no attribute 'TorchHook')

这是我的代码屏幕截图 [1]:https://i.stack.imgur.com/rPxWw.png

我的环境:Spyder(Python IDE)Ubuntu 20.04 python3

Del*_*lil 5

您使用的 syft 版本是 v0.3.0+。它不包含 syft.TorchHook,因为我相信我读到那里不需要它。使用 pip install syft==0.2.9 来使用 syft.TorchHook()。特别是如果您正在学习来自 Openmined Andrew Trask 的安全和私人课程。

请注意,如果您确实正在学习该课程,则 Openmined 团队已推出新的更新课程。有关更多详细信息,请参阅https://courses.openmined.org/courses/foundations-of-private-computation 。它基于 syft 的更新版本。