运行HGD数据集的 example.py 文件

使用HGD数据集时,需要从braindecode中调用相关的函数,但是在我的环境中运行时出现错误,现将解决过程记录,方便以后查阅。

注: 以下错误是在Numpy 1.24mne 0.19.0版本下出现的错误,其他版本的错误可能会有不同。

ModuleNotFoundError: No module named ‘braindecode.datautil.signalproc‘

该问题是导入braindecode的版本太新了,需要使用如下的代码安装低版本的braindecode:

pip install https://github.com/TNTLFreiburg/braindecode/archive/master.zip

关于低版本的braindecode的使用手册如下:

https://robintibor.github.io/braindecode/index.html

AttributeError: module ‘numpy‘ has no attribute ‘str‘

同样是库的版本的问题,搜了一下我是用的库的函数,发现如下的函数:
在这里插入图片描述

因此把np.str改成np.str_,就可以了。

AttributeError: ‘DataFrame’ object has no attribute ‘append’. Did you mean: ‘_append’?

如下为出现错误的代码:

self.epochs_df = self.epochs_df.append(row_dict, ignore_index=True)

将上述代码修改为如下即可:

self.epochs_df = self.epochs_df._append(row_dict, ignore_index=True)

AttributeError: ‘Series’ object has no attribute ‘iteritems’

如下为出现错误的代码:

for key, val in last_row.iteritems():

将上述代码修改为如下即可:

for key, val in last_row.items():

因为在我是用的哭的版本中找到了如下的API,故做此修改。

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值