tensorlayer / TensorLayer

Deep Learning and Reinforcement Learning Library for Scientists and Engineers
http://tensorlayerx.com
Other
7.31k stars 1.61k forks source link

AttributeError: module 'tensorlayer.layers' has no attribute 'clear_layers_name' #1094

Open qiyang77 opened 4 years ago

qiyang77 commented 4 years ago

I used tf.reset_default_graph() in tensorflow 1.x to repeat run a cell and it worked well (to generate many trianed model in one run). However, in tensorflow 2.0, tf.compat.v1.reset_default_graph() is not working and if I repeat run the cell a vaule error will happen: name x has been used.

I have noticed that tensorlayer.layers.clear_layers_name() can remove the layer space. However, seem like that tl.layers.clear_layers_name() was not available in tensorlayer 2.X.

The code is composed with tensorlayer 2.x and tensorflow 2.0. The question is how to reset the entire graph to repeat run my code in a 'for' circulation with tensorflow 2.0, or any other options for using tl.layers.clear_layers_name() like function?