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

[🐛BUG]照着官网教程自定义模型时报错 #1071

Closed
tctctctctc opened this issue Dec 3, 2021 · 2 comments
Closed

[🐛BUG]照着官网教程自定义模型时报错 #1071

tctctctctc opened this issue Dec 3, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@tctctctctc
Copy link

描述这个 bug
参照官网自定义模型部分,自定义模型继承GeneralRecommender。
在自定义模型中__init__方法中先调用父类的__init__,在父类即GeneralRecommender的__init__中有self.n_users = dataset.num(self.USER_ID)
而在run.py文件中传入自定义模型的是TrainDataLoader:train_data

如何复现
复现这个 bug 的步骤:

  1. 您引入的额外 yaml 文件
  2. 您的代码
  3. 您的运行脚本

预期
对您的预期作清晰简明的描述。

屏幕截图
报错信息
image
run.py
image

链接
添加能够复现 bug 的代码链接,如 Colab 或者其他在线 Jupyter 平台。(可选)

实验环境(请补全下列信息):

  • 操作系统: [Windows]
  • RecBole 版本 [1.0.0]
  • Python 版本 [3.68]
  • PyTorch 版本 [1.10]
  • cudatoolkit 版本 [none]
@tctctctctc tctctctctc added the bug Something isn't working label Dec 3, 2021
@Ethan-TZ Ethan-TZ self-assigned this Dec 3, 2021
@Ethan-TZ
Copy link
Member

Ethan-TZ commented Dec 3, 2021

@tctctctctc 感谢您对RecBole的关注与反馈!
模型构建部分文档确实存在错误,应修正为:
model = NewModel(config, train_data.dataset).to(config['device'])
我们后续会对文档进行修正,再次感谢您的反馈!

@2017pxy
Copy link
Member

2017pxy commented Dec 14, 2021

@tctctctctc 你好,感谢反馈,我们已经在 #1072 修复了这个问题。

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

4 participants