简体   繁体   English

如何替换TensorFlow 2.0“contrib”函数调用?

[英]How to replace TensorFlow 2.0 “contrib” function calls?

I am migrating my code from TensorFlow 1.13.1 to TensorFlow 2.0. 我正在将我的代码从TensorFlow 1.13.1迁移到TensorFlow 2.0。 However, "contrib" modules will be removed and I can't find a replacement for these functions: 但是,“contrib”模块将被删除,我找不到这些功能的替代品:

tf.contrib.layers.l2_regularizer

tf.contrib.image.transform

I thought about forking the whole "layers" and "image" directory, but this could get really messy, so I'd rather avoid that. 我想过分配整个“图层”和“图像”目录,但这可能会变得非常混乱,所以我宁愿避免这样做。

Thanks! 谢谢!

You can take a look at the regularization functions ' page of TF 2.0. 您可以查看TF 2.0的正则化函数页面。 There you can find l1, l2, and l1 & l2 regularizations. 在那里你可以找到l1,l2和l1&l2正则化。

Image preprocessing is now based on Keras syntax, you can find some hints here . 图像预处理现在基于Keras语法,您可以在这里找到一些提示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 tf.contrib 转换为 Tensorflow 2.0 - How to convert tf.contrib to Tensorflow 2.0 TensorFlow 2.0 将不包含 TensorFlow Contrib 模块 - Tensorflow Contrib module will not be included in TensorFlow 2.0 AttributeError:模块“tensorflow”在 tensorflow 2.0 中没有属性“contrib” - AttributeError: module 'tensorflow' has no attribute 'contrib' in tensorflow 2.0 模块 'tensorflow' 没有 tensorflow 2.0 版本的属性 'contrib' - Module 'tensorflow' has no attribute 'contrib' for the version tensorflow 2.0 TensorFlow 2.0中的tf.contrib.layers.recompute_grad在哪里? - Where is tf.contrib.layers.recompute_grad in TensorFlow 2.0? TensorFlow 2.0 中 tf.contrib.factorization.KMeans 的等效 API 是多少? - What is the equivalent API of tf.contrib.factorization.KMeans in TensorFlow 2.0? 将 tf.contrib.layers.batch_norm 迁移到 Tensorflow 2.0 - Migrate tf.contrib.layers.batch_norm to Tensorflow 2.0 相当于 tensorflow 2.0 中的 tf.contrib.image.transform? - The equivalent of tf.contrib.image.transform in tensorflow 2.0? 重写 Tensorflow 2.0 中的 tf.contrib.layers.batch_norm - Rewrite tf.contrib.layers.batch_norm in Tensorflow 2.0 如何使用张量流函数tf.contrib.legacy_seq2seq.sequence_loss_by_example的``权重''参数? - How to use the param of 'weights' of tensorflow function tf.contrib.legacy_seq2seq.sequence_loss_by_example?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM