gpt4 book ai didi

pysyft - 属性错误 : type object 'Tensor' has no attribute 'fft'

转载 作者:行者123 更新时间:2023-12-04 12:56:20 24 4
gpt4 key购买 nike

当我import syft ,出现以下错误:

AttributeError: type object 'Tensor' has no attribute 'fft'
我关注了 PySyft Doc安装syft。
我试过 import syft在 Ubuntu 18.04 和 Google Colab 环境中。两者都有相同的错误。
Google Colab 上的完整错误信息如下,
import syft as sf

---------------------------------------------------------------------------

AttributeError Traceback (most recent call last)

<ipython-input-4-71fdfd268bf5> in <module>()
----> 1 import syft as sf

9 frames

/usr/local/lib/python3.7/dist-packages/syft/__init__.py in <module>()
59 from syft.core.common.serde.serialize import _serialize as serialize # noqa: F401
60 from syft.core.node.common.service.repr_service import ReprMessage # noqa: F401
---> 61 from syft.core.node.device.device import Device # noqa: F401
62 from syft.core.node.device.device import DeviceClient # noqa: F401
63 from syft.core.node.domain.domain import Domain # noqa: F401

/usr/local/lib/python3.7/dist-packages/syft/core/node/device/__init__.py in <module>()
1 # syft relative
----> 2 from .client import DeviceClient
3 from .device import Device
4
5 __all__ = ["DeviceClient", "Device"]

/usr/local/lib/python3.7/dist-packages/syft/core/node/device/client.py in <module>()
14 from ...io.location import SpecificLocation
15 from ...io.route import Route
---> 16 from ..common.client import Client
17
18

/usr/local/lib/python3.7/dist-packages/syft/core/node/common/client.py in <module>()
18 from ....core.pointer.pointer import Pointer
19 from ....decorators import syft_decorator
---> 20 from ....lib import lib_ast
21 from ....proto.core.node.common.client_pb2 import Client as Client_PB
22 from ....proto.core.node.common.metadata_pb2 import Metadata as Metadata_PB

/usr/local/lib/python3.7/dist-packages/syft/lib/__init__.py in <module>()
24
25 # constructor: copyType = create_lib_ast
---> 26 lib_ast = create_lib_ast()
27 lib_ast._copy = create_lib_ast

/usr/local/lib/python3.7/dist-packages/syft/lib/__init__.py in create_lib_ast()
10
11 python_ast = create_python_ast()
---> 12 torch_ast = create_torch_ast()
13 torchvision_ast = create_torchvision_ast()
14 # numpy_ast = create_numpy_ast()

/usr/local/lib/python3.7/dist-packages/syft/lib/torch/__init__.py in create_torch_ast()
52 continue
53 ast.add_path(
---> 54 path=method, framework_reference=torch, return_type_name=return_type
55 )
56 # add all the torch.nn.Parameter hooks

/usr/local/lib/python3.7/dist-packages/syft/ast/globals.py in add_path(self, path, index, return_type_name, framework_reference)
64 if hasattr(attr, "add_path"):
65 attr.add_path( # type: ignore
---> 66 path=path, index=1, return_type_name=return_type_name
67 )
68

/usr/local/lib/python3.7/dist-packages/syft/ast/module.py in add_path(self, path, index, return_type_name, framework_reference)
119 if hasattr(attr, "add_path"):
120 attr.add_path( # type: ignore
--> 121 path=path, index=index + 1, return_type_name=return_type_name
122 )

/usr/local/lib/python3.7/dist-packages/syft/ast/callable.py in add_path(self, path, index, return_type_name)
80 if path[index] not in self.attrs:
81
---> 82 attr_ref = getattr(self.ref, path[index])
83
84 if isinstance(attr_ref, module_type):

AttributeError: type object 'Tensor' has no attribute 'fft'

有谁知道如何解决这个问题?谢谢。

最佳答案

pip 安装可与旧 pytorch 一起使用的较低版本的 pysyft。那将解决它。

关于pysyft - 属性错误 : type object 'Tensor' has no attribute 'fft' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66680070/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com