在使用gpu时,指标计算出错
Closed this issue · 2 comments
运行“python main.py --model_name BPRMF --emb_size 64 --lr 1e-3 --l2 1e-6 --dataset Grocery_and_Gourmet_Food --gpu 0”
部分结果为:
Device: cuda
Load corpus from ../data/Grocery_and_Gourmet_Food\BaseReader.pkl
#params: 1497344
BPRMF(
(u_embeddings): Embedding(14682, 64)
(i_embeddings): Embedding(8714, 64)
)
Optimizer: Adam
Epoch 1 loss=0.6931 [7.5 s] dev=(HR@5:1.0000,NDCG@5:1.0000) [6.3 s] *
Epoch 2 loss=0.6931 [6.9 s] dev=(HR@5:1.0000,NDCG@5:1.0000) [6.4 s] *
Epoch 3 loss=0.6931 [7.5 s] dev=(HR@5:1.0000,NDCG@5:1.0000) [6.5 s] *
Epoch 4 loss=0.6931 [7.6 s] dev=(HR@5:1.0000,NDCG@5:1.0000) [6.5 s] *
Epoch 5 loss=0.6931 [7.6 s] dev=(HR@5:1.0000,NDCG@5:1.0000) [6.4 s] *
Epoch 6 loss=0.6931 [7.0 s] dev=(HR@5:1.0000,NDCG@5:1.0000) [6.3 s] *
在使用cpu时计算正常
I also have the same problem. How did you solve it
I also have the same problem. How did you solve it
Changing the num_workers to 0 works for me.