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] 有个空指针异常能帮忙看看吗? #80

Open
alittlebitcool opened this issue Feb 6, 2024 · 1 comment
Open

[🐛BUG] 有个空指针异常能帮忙看看吗? #80

alittlebitcool opened this issue Feb 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@alittlebitcool
Copy link

总是报错这个问题:
Traceback (most recent call last):
File "/home/izuna/zyx/RecBole-GNN-main/run_recbole_gnn.py", line 19, in
run_recbole_gnn(model=args.model, dataset=args.dataset, config_file_list=config_file_list)
File "/home/izuna/zyx/RecBole-GNN-main/recbole_gnn/quick_start.py", line 48, in run_recbole_gnn
best_valid_score, best_valid_result = trainer.fit(
File "/home/izuna/zyx/rec/recbole/trainer/trainer.py", line 466, in fit
valid_score, valid_result = self._valid_epoch(
File "/home/izuna/zyx/rec/recbole/trainer/trainer.py", line 285, in _valid_epoch
valid_result = self.evaluate(
File "/opt/miniconda/envs/bole/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/izuna/zyx/rec/recbole/trainer/trainer.py", line 618, in evaluate
interaction, scores, positive_u, positive_i = eval_func(batched_data)
File "/home/izuna/zyx/rec/recbole/trainer/trainer.py", line 556, in _neg_sample_batch_eval
batch_user_num = positive_u[-1] + 1
TypeError: 'NoneType' object is not subscriptable

我的配置文件如下:
embedding_size: 64
leakyrelu_alpha: 0.2
dropout_local: 0.
dropout_global: 0.5
dropout_gcn: 0.
loss_type: CE
gnn_transform: sess_graph

global

build_global_graph: True
sample_num: 12
hop: 1
field: ~

topk: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
use_gpu: True
gpu_id: 0 # 根据实际情况设置 GPU 设备编号
seed: 2

dataset config

field_separator: " " #指定数据集field的分隔符
seq_separator: " " #指定数据集中token_seq或者float_seq域里的分隔符
USER_ID_FIELD: user_id #指定用户id域
ITEM_ID_FIELD: item_id #指定物品id域
RATING_FIELD: rating #指定打分rating域
#指定从什么文件里读什么列,这里就是从ml-1m.inter里面读取user_id, item_id, rating, timestamp这四列
load_col:
inter: [user_id, item_id, timestamp, rating]
TIME_FIELD: timestamp

training settings

#epochs: 2000 #训练的最大轮数
epochs: 2000 #训练的最大轮数
train_batch_size: 2048
learner: adam #使用的pytorch内置优化器
learning_rate: 0.01 #学习率
training_neg_sample_num: 0 #负采样数目
LABEL_FIELD: label #指定标签域
eval_type: 2

@alittlebitcool alittlebitcool added the bug Something isn't working label Feb 6, 2024
@konglongbaka
Copy link

我最近也是遇到了这个问题,请问你解决了吗,我是在复现SRGNN和LESSR时会有

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

2 participants