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

got this error, please help! #9

Open
hellomuse opened this issue Jul 6, 2019 · 19 comments
Open

got this error, please help! #9

hellomuse opened this issue Jul 6, 2019 · 19 comments

Comments

@hellomuse
Copy link

Traceback (most recent call last):
File "/Users/linda/mywork/ARGA-master/ARGA/arga/run.py", line 18, in
runner.erun()
File "/Users/linda/mywork/ARGA-master/ARGA/arga/link_prediction.py", line 27, in erun
placeholders = get_placeholder(feas['adj'])
KeyError: 'adj'

@EdisonLeeeee
Copy link

Traceback (most recent call last):
File "/Users/linda/mywork/ARGA-master/ARGA/arga/run.py", line 18, in
runner.erun()
File "/Users/linda/mywork/ARGA-master/ARGA/arga/link_prediction.py", line 27, in erun
placeholders = get_placeholder(feas['adj'])
KeyError: 'adj'

I met this problem, too. And I solved it by using python with version 3.7, and I run it successfully now.

Using py37, However, you may need to modify several pieces of code.

@TrabelsiAhmed
Copy link

Traceback (most recent call last):
File "/Users/linda/mywork/ARGA-master/ARGA/arga/run.py", line 18, in
runner.erun()
File "/Users/linda/mywork/ARGA-master/ARGA/arga/link_prediction.py", line 27, in erun
placeholders = get_placeholder(feas['adj'])
KeyError: 'adj'

I met this problem, too. And I solved it by using python with version 3.7, and I run it successfully now.

Using py37, However, you may need to modify several pieces of code.

Hello EdisonLeeeee,

I am trying to use the ARGA model with py37 too. So I need to modify the code in order to make it work. I am having some problems with that however. Could you be contact me? I could use your help.

@EdisonLeeeee
Copy link

Traceback (most recent call last):
File "/Users/linda/mywork/ARGA-master/ARGA/arga/run.py", line 18, in
runner.erun()
File "/Users/linda/mywork/ARGA-master/ARGA/arga/link_prediction.py", line 27, in erun
placeholders = get_placeholder(feas['adj'])
KeyError: 'adj'

I met this problem, too. And I solved it by using python with version 3.7, and I run it successfully now.
Using py37, However, you may need to modify several pieces of code.

Hello EdisonLeeeee,

I am trying to use the ARGA model with py37 too. So I need to modify the code in order to make it work. I am having some problems with that however. Could you be contact me? I could use your help.

Hi TrabelsiAhmed.

Can I do anything to help?

@TrabelsiAhmed
Copy link

Hi,

I am trying to debug the code step by step. Currently I am stuck with something that seems to be easy to solve.

I am getting this error:

Traceback (most recent call last):

File "C:\ARGA\ARGA\arga\run.py", line 18, in
runner.erun()

File "C:\ARGA\ARGA\arga\link_prediction.py", line 25, in erun
feas = format_data(self.data_name)

File "C:\ARGA\ARGA\arga\constructor.py", line 43, in format_data
adj, features, y_test, tx, ty, test_maks, true_labels = load_data(data_name)

File "C:\ARGA\ARGA\arga\input_data.py", line 24, in load_data
objects.append(pkl.load(open("data/ind.{}.{}".format(dataset, names[i])), encoding = 'ansi', errors = 'ignore'))

File "E:\Programme\py\envs\keras-gpu\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character maps to

I tried to solve it by trying different encodings, by addind errors = 'ignore'. But nothing works.
Can you please tell, what did you do to solve this?

Thank you in advance

@EdisonLeeeee
Copy link

EdisonLeeeee commented Dec 22, 2019

well, it is easy to solve this problem.

First I will introduce the solution below:

change the code in input.py, line 23-25:

    for i in range(len(names)):
        objects.append(pkl.load(open("data/ind.{}.{}".format(dataset, names[i]))))

to

    for name in names:
        with open("data/ind.{}.{}".format(dataset, name), 'rb') as f:
            objects.append(pkl.load(f, encoding='latin1'))

It occurs because of the version of pickle. (Not exactly!)

Hope it help for you!

@TrabelsiAhmed
Copy link

Yes it worked, thank you so much!

Of course I got another error, i will try to solve it myself.

Is it okey to contact you again if i get in trouble again? xD

@EdisonLeeeee
Copy link

Sure, but I'm not sure I'll be able to reply in time. XD

@TrabelsiAhmed
Copy link

No problem, only if you have time ofcourse :D

@TrabelsiAhmed
Copy link

Hi, I need help again xD

Traceback (most recent call last):

File "C:\ARGA\ARGA\arga\run.py", line 18, in
runner.erun()

File "C:\ARGA\ARGA\arga\link_prediction.py", line 34, in erun
opt = get_optimizer(model_str, ae_model, discriminator, placeholders, feas['pos_weight'], feas['norm'], d_real, feas['num_nodes'])

File "C:\ARGA\ARGA\arga\constructor.py", line 90, in get_optimizer
d_fake=d_fake)

File "C:\ARGA\ARGA\arga\optimizer.py", line 43, in init
beta1=0.9, name='adam2').minimize(self.generator_loss, var_list=en_var)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\training\optimizer.py", line 413, in minimize
name=name)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\training\optimizer.py", line 597, in apply_gradients
self._create_slots(var_list)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\training\adam.py", line 131, in _create_slots
self._zeros_slot(v, "m", self._name)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\training\optimizer.py", line 1156, in _zeros_slot
new_slot_variable = slot_creator.create_zeros_slot(var, op_name)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\training\slot_creator.py", line 190, in create_zeros_slot
colocate_with_primary=colocate_with_primary)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\training\slot_creator.py", line 164, in create_slot_with_initializer
dtype)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\training\slot_creator.py", line 74, in _create_slot_var
validate_shape=validate_shape)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\ops\variable_scope.py", line 1504, in get_variable
aggregation=aggregation)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\ops\variable_scope.py", line 1247, in get_variable
aggregation=aggregation)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\ops\variable_scope.py", line 567, in get_variable
aggregation=aggregation)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\ops\variable_scope.py", line 519, in _true_getter
aggregation=aggregation)

File "C:\Users\trahm\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\ops\variable_scope.py", line 886, in _get_single_variable
"reuse=tf.AUTO_REUSE in VarScope?" % name)

ValueError: Variable arga_32/Encoder/e_dense_1_vars/weights/adam2/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?

I don't have any idea to solve this :/

@EdisonLeeeee
Copy link

I'm not quite sure why this is happening, but I think it may caused by the code in optimizer.py:

self.generator_optimizer = tf.train.AdamOptimizer(learning_rate=FLAGS.discriminator_learning_rate, beta1=0.9, name='adam2').minimize(self.generator_loss, var_list=en_var)

There may have something wrong with that var_list=en_var, the variable of arga_32/Encoder/e_dense_1_vars/weights/adam2/ does not exist and it's really not going to do, maybe you can print it en_var.

BTW, it works well in my environment (py 3.7, tensorflow 1.12.0), MayI ask you that the version of tensorflow?

@TrabelsiAhmed
Copy link

I am using tensorflow 2.0.0. Should i downgrade it?

@EdisonLeeeee
Copy link

I am using tensorflow 2.0.0. Should i downgrade it?

Yes it must be. Tf2.0 if quite different from the previous version. You can downgrade it to any version except for 2.0 (1.12 1.13 1.14 is availiable).

@TrabelsiAhmed
Copy link

I will do it and tell you if it works.
Thank you :D

@EdisonLeeeee
Copy link

That's all right. Hope it works (if I'm not mistaken) : )

@TrabelsiAhmed
Copy link

It worked !!
Thank you man 💃

@EdisonLeeeee
Copy link

Great! : )

@DreamerDW
Copy link

Hello, I also encountered this problem, how did you solve it? Thank you!

@Billy1900
Copy link

Could anyone give me the code of python3.7 version? I try to transform it but met some problems.

@Billy1900
Copy link

Could anyone give me the code of python3.7 version? I try to transform it but met some problems.

I made it. Thanks!

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

5 participants