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()

 

posted @ 2022-04-10 18:23  FigureOut  阅读(168)  评论(0编辑  收藏  举报