<p>I have the same issue, but I don't really have time to write a library myself unfortunately. There are several potential options that I am considering: </p>

<ol>
<li><p>Stick with TF1.X until someone creates a library </p></li>
<li><p>Switch to using lightfm to continue using WALS </p></li>
<li><p>Switch to neural collaborative filtering using embedding layers with keras and a dot product layer. See this paper <a href="https://arxiv.org/abs/1708.05031" rel="nofollow noreferrer">https://arxiv.org/abs/1708.05031</a>, and this code implementation:</p></li>
</ol>

<pre><code>from tensorflow.keras.layers import Input, Embedding, Flatten, Dot, Dense
from tensorflow.keras.models import Model
#import tensorflow.distribute

def get_compiled_model(n_users, n_items, embedding_dims=20):
    # Product embedding
    prod_input = Input(shape=[1], name="Item-Input")
    prod_embedding = Embedding(n_items+1, embedding_dims, name="Item-Embedding")(prod_input)
    prod_vec = Flatten(name="Flatten-Product")(prod_embedding)

    # User embedding
    user_input = Input(shape=[1], name="User-Input")
    user_embedding = Embedding(n_users+1, embedding_dims, name="User-Embedding")(user_input)
    user_vec = Flatten(name="Flatten-Users")(user_embedding)

    # The output is the dot product of the two, i.e. a one-hot vector
    dot_product = Dot(name="Dot-Product", axes=1)([prod_vec, user_vec])

    # compile - uncomment these two lines to make training distributed
    # dist_strat = distribute.Strategy()
    # with dist_strat.scope():
    model = Model(inputs = [user_input, prod_input], outputs = dot_product)
    model.compile(
        optimizer='adam',
        loss='mean_squared_error'
    )
    return model


</code></pre>
Matrix Factorization in tensorflow 2.0 using WALS Method
<p>I am using WALS method in order to perform matrix factorization. Initially in tensorflow 1.13 I can import factorization_ops using</p>

<pre><code>from tensorflow.contrib.factorization.python.ops import factorization_ops 
</code></pre>

<p>As described in the <a href="https://github.com/GoogleCloudPlatform/tensorflow-recommendation-wals/blob/master/wals_ml_engine/trainer/wals.py" rel="nofollow noreferrer">documentation</a> </p>

<p>Wals model can be called from factorization_ops by using</p>

<pre><code>factorization_ops.WALSModel
</code></pre>

<p>Using same command in tensorflow 2.0 giving me following error</p>

<p><strong>ModuleNotFoundError: No module named 'tensorflow.contrib.factorization</strong></p>

<p>Going through the <a href="https://github.com/tensorflow/tensorflow/issues/31350" rel="nofollow noreferrer">issue</a> there appears to be no way out to use WALSModel in tensorflow 2.0+. </p>

<p>Also it has been mentioned <a href="https://github.com/tensorflow/tensorflow/releases" rel="nofollow noreferrer">here</a> in tensorflow release updates that tf.contrib has been deprecated, and functionality has been either migrated to the core TensorFlow API, to an ecosystem project such as tensorflow/addons or tensorflow/io, or removed entirely.</p>

<p>How can I use WALS model in tensorflow 2.0 (Currently I am using 2.0.0-rc0 on windows machine) ? Is WALSModel has been removed or I am missing out some information ?</p>