wujcan / SGL-TensorFlow

173 stars 43 forks source link

运行报错 #4

Closed lijhong closed 3 years ago

lijhong commented 3 years ago

你好,最近在看你论文,同时尝试运行了下代码,发现有报错,内容如下: Traceback (most recent call last): File "main.py", line 23, in seed = conf["seed"] File "/self-sup/SGL/util/configurator.py", line 128, in getitem raise KeyError("There are not the parameter named '%s'" % item) KeyError: "There are not the parameter named 'seed'" 请问下如何解决这个问题,谢谢。

wujcan commented 3 years ago

你好,最近在看你论文,同时尝试运行了下代码,发现有报错,内容如下: Traceback (most recent call last): File "main.py", line 23, in seed = conf["seed"] File "/self-sup/SGL/util/configurator.py", line 128, in getitem raise KeyError("There are not the parameter named '%s'" % item) KeyError: "There are not the parameter named 'seed'" 请问下如何解决这个问题,谢谢。

这个应该是你没设置对路径,你需要在main.py里设置root_folder为project的根目录。

libuyan-nuaa commented 2 years ago

你好,最近在看你的论文,尝试了代码,出现了下面的错误 (tensor) algroup@algroup:~/lxj/SGL-main$ python main.py --recommender=SGL seed= 2021 WARNING:tensorflow:From main.py:27: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead. split and save data... 2022-03-07 10:08:39.052: amazon-book_given_u0_i0 2022-03-07 10:08:39.053: Dataset name: amazon-book The number of users: 52643 The number of items: 91599 The number of ratings: 2984108 Average actions of users: 56.69 Average actions of items: 32.58 The sparsity of the dataset: 99.938115% Item degree grouping... Traceback (most recent call last): File "main.py", line 33, in dataset = Dataset(conf) File "/home/algroup/lxj/SGL-main/data/dataset.py", line 37, in init self._group_item_by_popularity() File "/home/algroup/lxj/SGL-main/data/dataset.py", line 262, in _group_item_by_popularity self.item_group[i] = i_degree[self.item_group_idx == i] AttributeError: 'Dataset' object has no attribute 'item_group'