knowledge_graph_attention_network icon indicating copy to clipboard operation
knowledge_graph_attention_network copied to clipboard

AttributeError: 'KGAT' object has no attribute 'ua_embeddings'

Open liupenggg opened this issue 5 years ago • 18 comments

AttributeError: 'KGAT' object has no attribute 'ua_embeddings' ??

liupenggg avatar Sep 23 '19 07:09 liupenggg

?? Sorry. Others using the codes do not have the error.

xiangwang1223 avatar Oct 17 '19 12:10 xiangwang1223

我也遇到了这个问题

Aliang-CN avatar Nov 01 '19 05:11 Aliang-CN

hi, could you please show me your running command & parameter settings?

xiangwang1223 avatar Nov 01 '19 06:11 xiangwang1223

WARNING:tensorflow:From D:\Program Files\anaconda3\envs\data_analysis\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. using xavier initialization Traceback (most recent call last): File "D:\Program Files\anaconda3\envs\data_analysis\lib\site-packages\IPython\core\interactiveshell.py", line 3325, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('E:/project/knowledge_graph_attention_network-master/Model/Main.py', wdir='E:/project/knowledge_graph_attention_network-master/Model') File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "E:/project/knowledge_graph_attention_network-master/Model/Main.py", line 158, in model = KGAT(data_config=config, pretrain_data=pretrain_data, args=args) File "E:\project\knowledge_graph_attention_network-master\Model\KGAT.py", line 29, in init self._build_model_phase_I() File "E:\project\knowledge_graph_attention_network-master\Model\KGAT.py", line 136, in _build_model_phase_I self.u_e = tf.nn.embedding_lookup(self.ua_embeddings, self.users) AttributeError: 'KGAT' object has no attribute 'ua_embeddings'

Aliang-CN avatar Nov 04 '19 02:11 Aliang-CN

这个比较诡异,我用pycharm run的时候会出现这个报错,如果在终端下run就不会报错,但是一直卡在without pretraining上。

Aliang-CN avatar Nov 04 '19 02:11 Aliang-CN

你好,请问without pretraining这个问题你最后解决了吗,我也是因为这个问题!

DOGEE7 avatar Nov 07 '19 03:11 DOGEE7

换机器跑,我换了1080ti跑,跑一个epoch要600s吧

Aliang-CN avatar Nov 10 '19 16:11 Aliang-CN

1660ti能跑吗

liupenggg avatar Nov 11 '19 07:11 liupenggg

1660ti应该可以跑吧,不过应该很慢很慢

Aliang-CN avatar Nov 14 '19 01:11 Aliang-CN

大家好,请问AttributeError: 'KGAT' object has no attribute 'ua_embeddings'这个问题你们都是则么解决的呀 非常感谢! Hello everyone, please tell me how to solve AttributeError: 'KGAT' object has no attribute 'ua_embeddings' . thank you very very much!

diaoyudiaochan avatar Dec 19 '19 13:12 diaoyudiaochan

同样遇到了这个问题。。。

quanjing avatar Feb 29 '20 08:02 quanjing

我也有这个问题: Traceback (most recent call last): File "E:\eclipse_workspace\knowledge_graph_attention_network-master\Model\Main.py", line 94, in model = KGAT(data_config=config, pretrain_data=pretrain_data, args=args) File "E:\eclipse_workspace\knowledge_graph_attention_network-master\Model\KGAT.py", line 38, in init self._build_model_phase_I() File "E:\eclipse_workspace\knowledge_graph_attention_network-master\Model\KGAT.py", line 176, in _build_model_phase_I self.u_e = tf.nn.embedding_lookup(self.ua_embeddings, self.users) AttributeError: 'KGAT' object has no attribute 'ua_embeddings'

gxw928 avatar May 15 '20 01:05 gxw928

这个比较诡异,我用pycharm run的时候会出现这个报错,如果在终端下run就不会报错,但是一直卡在without pretraining上。

我在终端跑也是出现 without pretrain,之后就没反应了

wuziteng avatar Jun 19 '20 02:06 wuziteng

Hi all,

  1. Please use the command of README in the terminal to run the code. 请在命令行中使用README中的命令;
  2. GPU is recommended to run the code. 推荐使用GPU去跑代码,一般卡在without pretrain是由于使用CPU计算时间过长导致的。
  3. You can set the larger batch size to speed up. 如果使用GPU但是每个epoch时间太久的话,可以适当增大batch size来提速。

希望能解决各位的疑惑。

xiangwang1223 avatar Jun 19 '20 03:06 xiangwang1223

Hi all,

1. Please use the command of README in the terminal to run the code. 请在命令行中使用README中的命令;

2. GPU is recommended to run the code. 推荐使用GPU去跑代码,一般卡在without pretrain是由于使用CPU计算时间过长导致的。

3. You can set the larger batch size to speed up. 如果使用GPU但是每个epoch时间太久的话,可以适当增大batch size来提速。

希望能解决各位的疑惑。

谢谢作者,但是上面的这个AttributeError: 'KGAT' object has no attribute 'ua_embeddings'一直没解决

wuziteng avatar Jun 19 '20 03:06 wuziteng

请问你运行的命令是什么呢?

xiangwang1223 avatar Jun 19 '20 03:06 xiangwang1223

python Main.py --model_type kgat --alg_type ngcf --adj_type bi --dataset yelp2018 --regs [1e-5,1e-5] --layer_size [64,32,16] --embed_size 64 --lr 0.0001 --epoch 1000 --verbose 50 --save_flag 1 --pretrain 0 --batch_size 1024 --node_dropout [0.1] --mess_dropout [0.1,0.1,0.1] --use_att True --use_kge True

Hi all,

1. Please use the command of README in the terminal to run the code. 请在命令行中使用README中的命令;

2. GPU is recommended to run the code. 推荐使用GPU去跑代码,一般卡在without pretrain是由于使用CPU计算时间过长导致的。

3. You can set the larger batch size to speed up. 如果使用GPU但是每个epoch时间太久的话,可以适当增大batch size来提速。

希望能解决各位的疑惑。

python Main.py --model_type kgat --alg_type ngcf --adj_type bi --dataset yelp2018 --regs [1e-5,1e-5] --layer_size [64,32,16] --embed_size 64 --lr 0.0001 --epoch 1000 --verbose 50 --save_flag 1 --pretrain 0 --batch_size 1024 --node_dropout [0.1] --mess_dropout [0.1,0.1,0.1] --use_att True --use_kge True

wuziteng avatar Jun 19 '20 03:06 wuziteng

请把--alg_type ngcf换成--alg_type bi试一下。 readme中有标注,alg_type参数的选值在[kgat, gcn, graphsage],我这里没有写清楚kgat和bi相等,稍后会更新一下代码。

xiangwang1223 avatar Jun 19 '20 03:06 xiangwang1223