Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liupenggg opened this issue Sep 23, 2019 · 18 comments
Open

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

liupenggg opened this issue Sep 23, 2019 · 18 comments

Comments

@liupenggg
Copy link

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

@xiangwang1223
Copy link
Owner

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

@Aliang-CN
Copy link

我也遇到了这个问题

@xiangwang1223
Copy link
Owner

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

@Aliang-CN
Copy link

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
Copy link

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

@DOGEE7
Copy link

DOGEE7 commented Nov 7, 2019

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

@Aliang-CN
Copy link

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

@liupenggg
Copy link
Author

1660ti能跑吗

@Aliang-CN
Copy link

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

@diaoyudiaochan
Copy link

大家好,请问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!

@quanjing
Copy link

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

@gxw928
Copy link

gxw928 commented May 15, 2020

我也有这个问题:
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'

@wuziteng
Copy link

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

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

@xiangwang1223
Copy link
Owner

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来提速。

希望能解决各位的疑惑。

@wuziteng
Copy link

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'一直没解决

@xiangwang1223
Copy link
Owner

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

@wuziteng
Copy link

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

@xiangwang1223
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants