我使用 tf.contrib.slim
的 python 代码有问题功能并且在升级到 tensorflow 到 2.0 后不再起作用。
如何将以下内容升级到 tf 2.0:
import tensorflow.contrib.slim as slim
import tensorflow.contrib.slim.nets
# ...
net = slim.conv2d(
inp,
dim,
[3, 3],
rate=1,
normalizer_fn=slim.layer_norm,
activation_fn=lrelu,
scope='g_' + str(width) + '_conv1')
谢谢。
最佳答案
您可以使用 tf_slim
包代替( https://github.com/google-research/tf-slim )
但是,将包更新到 TF2 的推送请求仍然未决。所以你应该从分支安装pip install git+https://github.com/adrianc-a/tf-slim.git@remove_contrib
关于python - 手动将 tf.contrib.slim 升级到 tf 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58628439/