AttributeError: module ‘tensorly‘ has no attribute ‘SVD_FUNS‘

这是因为tensorly使用的python版本太低,我之前用的是3.6版的。换成3.8之后就可以成功运行了。
测试代码来自官方文档

import numpy as np
import tensorly as tl
from tensorly.decomposition import tucker
tl.set_backend('numpy')
tensor = tl.tensor([[0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
                    [0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 0.],
                    [0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 0.],
                    [0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 0.],
                    [0., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0.],
                    [0., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0.],
                    [0., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0.],
                    [0., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0.],
                    [0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 0.],
                    [0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 0.],
                    [0., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 0.],
                    [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]])
core, factors = tucker(tensor, rank=[2, 3])

[f.shape for f in factors]
print("hi")


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]:在编写Python脚本过程中,你遇到了一个报错:AttributeError: 'module' object has no attribute 'core'。这个错误通常是由于命名冲突或者版本不兼容引起的。引用\[2\]:参照通用解决方法并没有解决你的报错,最后你发现自己新建的Python文件名字和内置的函数名冲突,修改了Python文件的名字后问题得到解决。引用\[3\]:在训练YOLO模型时,你遇到了AttributeError: module pynvml has no attribute _nvmlGetFunctionPointer的报错。后来发现这是由于numpy版本问题引起的,因为在NumPy 1.20中已经弃用了numpy.int,在NumPy 1.24中已经删除了。你可以通过重新安装numpy或者修改代码来解决这个问题。 综上所述,你遇到的AttributeError: module pynvml has no attribute _nvmlGetFunctionPointer的报错可能是由于numpy版本不兼容引起的。你可以尝试重新安装numpy或者修改代码来解决这个问题。 #### 引用[.reference_title] - *1* *2* [【Python 脚本报错】AttributeError:‘module‘ has no attribute ‘xxx‘的解决方法](https://blog.csdn.net/qq_35091353/article/details/115609471)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [AttributeError: module numpy has no attribute int .报错解决方案](https://blog.csdn.net/weixin_46669612/article/details/129624331)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值