RecBole-CDR icon indicating copy to clipboard operation
RecBole-CDR copied to clipboard

[🐛BUG] TypeError: expected Tensor as element 0 in argument 0, but got Interaction

Open yoosan opened this issue 1 year ago • 2 comments

Hi developers, I am a new user of RecBole-CDR. I follow the tutorial and reproduce the DTCDR method, but got an error.

Here is the overall config: I modified the eval_args.mode from full to uni999, I guss this change cause the error, could you tell me how to fix it?

# general
gpu_id: 0
use_gpu: True
seed: 2022
state: INFO
reproducibility: True
data_path: 'dataset/'
checkpoint_dir: 'saved'
show_progress: True
save_dataset: False
dataset_save_path: ~
save_dataloaders: False
dataloaders_save_path: ~
log_wandb: False
wandb_project: 'recbole_cdr'

# training settings
train_epochs: ["BOTH:300"]
train_batch_size: 4096
learner: adam
learning_rate: 0.0005 #0.001
neg_sampling:
  uniform: 1
eval_step: 1
stopping_step: 10
clip_grad_norm: ~
# clip_grad_norm:  {'max_norm': 5, 'norm_type': 2}
weight_decay: 0.0
loss_decimal_place: 4
require_pow: False

# evaluation settings
eval_args: 
  split: {'RS':[0.8,0.1,0.1]}
  split_valid: {'RS':[0.8,0.2]}
  group_by: user
  order: RO
  mode: uni999 # full
repeatable: False
metrics: ["Recall","MRR","NDCG","Hit","Precision"]
topk: [10]
valid_metric: MRR@10
valid_metric_bigger: True
eval_batch_size: 409600
metric_decimal_place: 4

Others config here

DTCDR.yaml

embedding_size: 64
base_model: NeuMF
mlp_hidden_size: [64, 64]
dropout_prob: 0.3
alpha: 0.3

dataset config

# dataset config
gpu_id: 0
state: INFO
seed: 2022
field_separator: "\t"
source_domain:
  dataset: AmazonBooks
  data_path: '/data/home/work/projects/RecBole-CDR/recbole_cdr/dataset_example/'
  USER_ID_FIELD: user_id
  ITEM_ID_FIELD: item_id
  RATING_FIELD: rating
  TIME_FIELD: timestamp
  NEG_PREFIX: neg_
  LABEL_FIELD: label
  load_col:
    inter: [user_id, item_id, rating]
  user_inter_num_interval: "[10,inf)"
  item_inter_num_interval: "[10,inf)"
  val_interval:
    rating: "[3,inf)"
  drop_filter_field: True

target_domain:
  dataset: AmazonMov
  data_path: '/data/home/work/projects/RecBole-CDR/recbole_cdr/dataset_example/'
  USER_ID_FIELD: user_id
  ITEM_ID_FIELD: item_id
  RATING_FIELD: rating
  TIME_FIELD: timestamp
  NEG_PREFIX: neg_
  LABEL_FIELD: label
  load_col:
    inter: [user_id, item_id, rating]
  user_inter_num_interval: "[10,inf)"
  item_inter_num_interval: "[10,inf)"
  val_interval:
    rating: "[3,inf)"
  drop_filter_field: True

yoosan avatar Dec 19 '22 08:12 yoosan