Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LR/FM/DeepFM这几个模型运用ml-100k跑Recall, MRR,NDCG,Hit,Precision评价指标报错了 #1977

Closed
catmint999 opened this issue Jan 22, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@catmint999
Copy link

问题如题,我讲述一下我的运营流程:

  1. 在终端中运行:python run_recbole.py --model=WideDeep --dateset = ml-100k --config_files=test_ml.yaml
截屏2024-01-22 23 13 07 batch_user_num = positive_u[-1] + 1 TypeError: 'NoneType' object is not subscriptable
  1. 其中test_ml.yaml文件的内容如下:

新手入门:https://blog.csdn.net/Turinger_2000/article/details/111493291

evalution settings

eval_setting: TO_LS,full #对数据按时间排序,设置留一法划分数据集,并使用全排序
metrics: ["Recall", "MRR","NDCG","Hit","Precision"] #评测标准
valid_metric: MRR@10 #选取哪个评测标准作为作为提前停止训练的标准
eval_batch_size: 4096 #评测的batch_size

我猜测是否是因为ContextRecommender基础类与Recall, MRR,NDCG,Hit,Precision这几个评价指标不兼容。我运行din、dien上没有遇到这个问题

@catmint999 catmint999 added the bug Something isn't working label Jan 22, 2024
@teal024
Copy link

teal024 commented Feb 8, 2024

同样遇到了这个错误

@Yilu114
Copy link
Collaborator

Yilu114 commented Mar 3, 2024

您好,
您在运行RecBole时遇到的错误似乎与batch_user_num的计算有关,具体是batch_user_num = positive_u[-1] + 1这一行。错误消息表明'NoneType'对象不可订阅。

以下是一些诊断和可能解决问题的步骤:

  1. 检查数据加载

    • 确保您的数据集(ml-100k)正确加载并包含有效的用户-项目互动。
    • 验证您的test_ml.yaml配置文件中指定的数据路径指向正确的位置。
  2. 检查positive_u

    • 错误发生在尝试访问positive_u的索引时,positive_u似乎是一个列表或数组。
    • 检查positive_u是否正确初始化并包含有效数据。它应该是正用户索引的列表。
  3. 调试计算

    • 检查定义positive_u的上下文以及它如何用于计算batch_user_num
    • 确保positive_u不是None且具有有效值。
  4. 查看run_recbole.py脚本

    • 仔细检查您用来运行RecBole的命令:python run_recbole.py --model=WideDeep --dateset=ml-100k --config_files=test_ml.yaml
    • 确保没有拼写错误或遗漏的参数。

如果您继续面临问题,考虑提供更多上下文或分享额外的代码片段以便进一步调查。此外,检查RecBole文档或社区资源,了解与此错误相关的任何特定故障排除步骤,以下的文档链接可以进行参考。

@Yilu114 Yilu114 closed this as completed Mar 3, 2024
@houWenK
Copy link

houWenK commented Oct 2, 2024

问题如题,我讲述一下我的运营流程:

  1. 在终端中运行:python run_recbole.py --model=WideDeep --dateset = ml-100k --config_files=test_ml.yaml

截屏2024-01-22 23 13 07 batch_user_num = positive_u[-1] + 1 TypeError: 'NoneType' object is not subscriptable
2. 其中test_ml.yaml文件的内容如下:

新手入门:https://blog.csdn.net/Turinger_2000/article/details/111493291

evalution settings

eval_setting: TO_LS,full #对数据按时间排序,设置留一法划分数据集,并使用全排序 metrics: ["Recall", "MRR","NDCG","Hit","Precision"] #评测标准 valid_metric: MRR@10 #选取哪个评测标准作为作为提前停止训练的标准 eval_batch_size: 4096 #评测的batch_size

我猜测是否是因为ContextRecommender基础类与Recall, MRR,NDCG,Hit,Precision这几个评价指标不兼容。我运行din、dien上没有遇到这个问题

同学,你解决了吗,咋解决的

@staphylinid
Copy link

才发现昨天是这个问题的周年纪念,,,但是还是没有解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants