其他分享
首页 > 其他分享> > tensorflow 1.x 迁移到2.x

tensorflow 1.x 迁移到2.x

作者:互联网

tensorflow 1.x的contrib.layers写法

w_init = tf.contrib.layers.variance_scaling_initializer()

迁移到tensorflow2.x报错

AttributeError: module 'tensorflow' has no attribute 'contrib'

修改为

w_init=tf_slim.layers.initializers.variance_scaling_initializer()

 

标签:layers,initializer,scaling,tf,contrib,tensorflow,迁移
来源: https://www.cnblogs.com/gishuanhuan/p/16126991.html