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
failed precondition: error while reading resource variable block8_sepconv3_bn/gamma #43452
Comments
Can you check #28287 (comment) |
Hello, thank you very much for the suggestion. I indeed had a look at that thread as well and tried the solution. But I might have done it wrong. My understanding about sessions, graphs and threads might be a little bit lackluster as well, apologies for that. I created on line 70 my gpu_options and my sess at the begining of my script after the regular imports: gpu_options=tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=MEMORY_FRACTION) #TENSORFLOW DON'T USE ALL MY GPU PLZ
sess=set_session(tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(gpu_options=gpu_options))) I understand I should also declare here the graph globally instead of declaring it in the init function of my DQNAgent and should therefore also put : graph = tf.compat.v1.get_default_graph() then, if my understanding of the problem is correct, I should then set the session every time I am calling the .predict method in the train function of my DQNAgent class. I suppose that I should then use the following syntax: global sess
global graph
with self.graph.as_default():
set_session(sess)
current_qs_list = self.model.predict(current_states, PREDICTION_BATCH_SIZE)
new_current_states = np.array([transition[3] for transition in minibatch])/255 global sess
global graph
with self.graph.as_default():
set_session(sess)
future_qs_list = self.target_model.predict(new_current_states, PREDICTION_BATCH_SIZE) Not sure I should add it here though as there is no graph involved : def get_qs(self, state):
return self.model.predict(np.array(state).reshape(-1, * state.shape)/255)[0] would that make sense? |
I think that it is not a bug so you can close this. |
Hi, |
Hello,
I have found very few documentation concerning the error : failed precondition: error while reading resource variable block8_sepconv3_bn/gamma from Container: localhost. This could mean that the variable was uninitialized. Not found : Resource localhost/block8_speconv3_bn/gamma/class tensorflow::Var does not exist
I guess the problem must be in the train function before the model.predict and has something to do with the sessions and threads but I would be happy to get any help I can get.
I use :
Python 3.7.8
Cuda 10.1
CUDNN v7.6.5
Tensorflow 2.3.0
keras 2.4.3
You can find my code in attachment or here : https://github.com/8rax/Carla/blob/master/JDO_Tutorial_5.py
Carla_Env_DQN.zip
The text was updated successfully, but these errors were encountered: