Closed Pursuerwener closed 1 year ago
after i run the code python run_kgrec.py --dataset ailibaba-fashion i run the code again i get this running report And then I got this error.Unable to obtain results NameError: name 'test_user_set' is not defined Requesting Your Help
Hi,
Can you post the error stack track so that I can better help?
在我的运行代码 python run_kgrec.py --dataset ailibaba-fashion 之后, 我再次运行代码, 我得到了这个运行报告 ,然后我得到了这个错误。 无法获取结果 NameError: name 'test_user_set' is not Defined 请求您的帮助
我也出现了这个问题,请问您解决了吗
Hi,
Can you post the error stack track so that I can better help? 为什么会出现上述情况呀,为什么train_cf_triples:那个进度条不动,和楼上情况一样
@wangte123 看起来只是因为打印了std值,截断了一次tqdm progress bar的打印而已,运行时有error吗?
After running long time ,the error is NameError: name 'test_user_set' is not Defined.Not only the KGRec had the error but also the KGIN had the same problem.I 'm trying to change the code. `Traceback (most recent call last): File "D:\Software\Anaconda\envs\pytorch\lib\multiprocessing\pool.py", line 125, in worker result = (True, func(*args, *kwds)) File "D:\Software\Anaconda\envs\pytorch\lib\multiprocessing\pool.py", line 48, in mapstar return list(map(args)) File "E:\FengHanWen\experiment-1\KGRec-main\utils\evaluate_kgsr.py", line 93, in test_one_user user_pos_test = test_user_set[u] NameError: name 'test_user_set' is not defined """
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "run_kgrec.py", line 141, in
@Pursuerwener
it's strange since test_user_set
should be globalized at line 117 global train_user_set, test_user_set
.
Would you provide full script for evaluate_kgsr.py
?
Thanks for your reply
yes,I noticed your code global train_user_set, test_user_set
as soon as I started reproducing it.
This error also exists in the evaluate.py
when i run the run_kgin.py
Fortunately,the running of KGCL is no problem
code.zip
That's because KGCL uses a class-based evaluator. I guess the problem lies in multiprocessing on Windows. Plz try any of the potential solutions:
i use your second method
i get this error
Traceback (most recent call last): File "run_kgin.py", line 126, in <module> ret = Evaluator.test(model, user_dict, n_params) TypeError: test() missing 1 required positional argument: 'n_params'
running the run_kgrec.py
is the same as above
but i checked the evaluator.py
,it' no problem
i think that the problem is processing on Windows
You have to modify your codes to pass n_params
to Evaluator.test()
Thank you very much for sharing i run the code python run_kgrec.py --dataset last-fm to process the dataset When I ran it(python run_kgrec.py --dataset last-fm) the second time to train i get this error
NameError: name 'test_user_set' is not defined