TypeError: __init__() got an unexpected keyword argument ‘comment‘

问题记录:

在使用tsai库运行rocket算法时,系统报错

Traceback (most recent call last):
File "D:/JetBrains/timeseries/test.py", line 29, in
X_train, y_train = create_rocket_features(dls.train, model)
File "D:\JetBrains\timeseries\venv\lib\site-packages\tsai\models\ROCKET.py", line 140, in create_rocket_features
for i,(xb,yb) in enumerate(progress_bar(dl, display=verbose, leave=False, comment='batch/batches')):
TypeError: init() got an unexpected keyword argument 'comment'

尝试解决方法

1、更新包
重新加载progress_bar()所需要的fastprogress包,还是报错

import fastprogress

2、在github上搜索discussion,有人遇到同样问题,并向作者提问,但作者并为给出解答,因为作者代码可以正常运行
作者给出了自己的运行环境

os             : Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic
python         : 3.7.12
tsai           : 0.3.1
fastai         : 2.5.3
fastcore       : 1.3.29
fastprogress   : 1.0.2
torch          : 1.10.0+cu111
device         : 1 cuda (['Tesla P100-PCIE-16GB'])
n_cpus         : 2
RAM            : 12.69 GB
GPU memory     : [15.9] GB

根据作者给出的方法,看查看自己的环境

from tsai.all import *
import fastprogress
my_setup(fastprogress)

经过查看,博主当时环境与作者略有不同,但经过重新下载包后,环境如下,但依旧报相同的错

os             : Windows-10-10.0.19041-SP0
python         : 3.7.13
tsai           : 0.3.1
fastai         : 2.5.3
fastcore       : 1.3.29
fastprogress   : 1.0.2
torch          : 1.10.2+cpu
device         : cpu
cpu cores      : 8
RAM            : 15.79 GB
GPU memory     : [2.0] GB

3、重新创建一个环境,并安装包
博主找了另外一个torch版本为3.8.1的环境重新安装tsai库,成功运行,成功运行的环境为

os              : Windows-10-10.0.19044-SP0
python          : 3.8.13
tsai            : 0.3.4
fastai          : 2.7.10
fastcore        : 1.5.27
fastprogress    : 1.0.3
torch           : 1.8.1
device          : 1 gpu (['NVIDIA GeForce MX450'])
cpu cores       : 4
threads per cpu : 2
RAM             : 15.79 GB
GPU memory      : [2.0] GB
总结:猜测报错原因为未使用GPU,而是在CPU环境运行
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值