Engineer1999 / Double-Deep-Q-Learning-for-Resource-Allocation

Reproduce results of the research article "Deep Reinforcement Learning Based Resource Allocation for V2V Communications"
205 stars 55 forks source link

Question about Main code #8

Open Judithcodes opened 3 years ago

Judithcodes commented 3 years ago

Hello. When i run the main code, i get the error message that Flag model has been defined twice. Did anyone experience this and how did you handle it

image

Engineer1999 commented 3 years ago

I never got this error when I was working on the code. I have run this program multiple times and in different environments. I request you to share the full error and if you have made some changes then also share those changes as well.

Judithcodes commented 3 years ago

I am actually the code in jupyter lab When i run the initial code. I got the error message in the snip below.

image

so I changed the line:

import tensorflow as tf

to

import tensorflow.compat.v1 as tf

and

tf.app.run()

to

tf.compat.v1.app.run()

I no longer recall the error message that prompted me to add the line of code below:

tf.disable_v2_behavior()
import sys
sys.argv = sys.argv[:1] 

After running the code, i got the error message below:

image

Judithcodes commented 3 years ago

I just tried agent.py running from a terminal and i got the initial error message

image

apoorvsinghnegi commented 3 years ago

I just tried agent.py running from a terminal and i got the initial error message

image

how did you solve this error, I am also getting the same error

Judithcodes commented 3 years ago

I have been unable to resolve this issue.

Judithcodes commented 3 years ago

This is working now

image

I just downgraded my python version to python 3.6 and changed import tensorflow as tf to import tensorflow.compat.v1 as tf then i added

tf.disable_v2_behavior()

All of these in the agent code...

axuey commented 3 years ago

I just tried agent.py running from a terminal and i got the initial error message image

how did you solve this error, I am also getting the same error

This may be a problem with your tensorflow version. Some of the tensorflow commands can not use. You can try to downgrade to version 1.12 and run it again

1219-wangjindong commented 1 year ago

Hello, I adjusted the number of vehicles, but it reported an error. Is the number of vehicles adjusted in the position of environment initialization?