tensorflow / agents

TF-Agents: A reliable, scalable and easy to use TensorFlow library for Contextual Bandits and Reinforcement Learning.
Apache License 2.0
2.81k stars 720 forks source link

Duplicated weight name in networks.utils.mlp_layers #88

Open emailweixu opened 5 years ago

emailweixu commented 5 years ago

The dense layers created in mlp_layers have same names: https://github.com/tensorflow/agents/blob/82317735484b99f8bcb6ec7cb99d1e73f058ca55/tf_agents/networks/utils.py#L172

Because of this, eager_utils.add_variables_summaries cannot generate summary for all the weights.

oars commented 5 years ago

Yeah, I actually just noticed this with V2 setups a day or two ago as well. It's an issue now that variables are not generated with unique names. They used to come from tf.Graph op names.

Looking at options to make them unique in V2.

emailweixu commented 5 years ago

@oars, this problem persists even with tf2.0 rc1. Now it's not just the problem of ml_layers. EnocdingNetwork also has this problem since EncodingNetwork creates the layers itself, Do you have any problem to fix it? It's quite confusing when I want to actually examine the values and gradients of those layers.