1

How to replace from tensorflow.contrib import layers with new core functionality. I want to move my TF 1.4 code to 1.12 in preparation for TF 2.0.

gogasca
  • 9,283
  • 6
  • 80
  • 125

1 Answers1

2

The core functionality corresponding to tf.contrib.layers is in tf.layers. Some of the differences are discussed in this question. However this will not prepare you for TF 2.0.

If your goal is to prepare your code for TF 2.0, consider that tf.contrib will be removed entirely (either split from TF or integrated into it) and that tf.layers too will be removed and the high-level API will reside under tf.keras. So to best prepare for TF 2.0 you should start using tf.keras.layers instead.

Here is a blog post about some of the practical differences to expect with TF 2.0.

buzjwa
  • 2,632
  • 2
  • 24
  • 37