Skip to content

运行KD_DAGFM时报错:No module named 'lightgbm' #2172

@jobs08

Description

@jobs08

使用ML-1M数据集运行KD_DAGFM_train时,报错如下:
File "D:\Tools\PyCharm2024\WorkSpace\Recbole\RecBole-master\recbole\model\exlib_recommender_init_.py", line 1, in
from recbole.model.exlib_recommender.lightgbm import LightGBM
File "D:\Tools\PyCharm2024\WorkSpace\Recbole\RecBole-master\recbole\model\exlib_recommender\lightgbm.py", line 11, in
import lightgbm as lgb
ModuleNotFoundError: No module named 'lightgbm'

recbole版本:1.1.1
ymal文件如下:

model config

model: KD_DAGFM
dataset: ml-1m
embedding_size: 10
reg_weight: 2
seed: 2020
teacher: CrossNet
phase: teacher_training
type: outer
t_depth: 3
depth: 3
alpha: 0.1
beta: 921.6
t_cin: [200, 200, 200]

dataset config

field_separator: "\t" # 指定数据集field的分隔符
seq_separator: " " # 指定数据集中token_seq或者float_seq域里的分隔符
USER_ID_FIELD: user_id # 指定用户id域(目标域)
ITEM_ID_FIELD: item_id # 指定物品id域(武器域)
RATING_FIELD: rating # 指定打分rating域
TIME_FIELD: timestamp # 指定时间域
NEG_PREFIX: neg_ # 指定负采样前缀
LABEL_FIELD: label # 指定标签域

threshold:
rating: 3

制定从什么文件里读什么列,这里就是从ml-1m.inter里面读取user_id,item_id,rating,timestamp这四列

load_col:
inter: [user_id, item_id, rating]
user: [user_id, age, gender, occupation]
item: [item_id,movie_title, release_year, genre]

training settings

epochs: 300 # 训练的最大轮数
train_batch_size: 4096 # 训练的batch_size
learner: adam # 使用的pytorch内置优化器
learning_rate: 0.001 # 学习率
train_neg_sample_args: ~

eval_step: 1 # 每次训练后做evalaution的次数
stopping_step: 30 # 控制训练收敛的步骤数,在该步骤内若选取的评测标准没有什么变化,就可以提前终止

evalution settings

eval_args:
split: {'RS': [0.8,0.1,0.1]} # 划分比例
order: RO
guoup_by: ~
mode: labeled

metrics: ["AUC","Logloss"] # 评测标准
valid_metric: AUC
eval_batch_size: 4096 # 评测的batch_size

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions