Code Monkey home page Code Monkey logo

Comments (7)

101Priyanshi avatar 101Priyanshi commented on June 26, 2024

since your issue is not very old so I guess you have Tensorflow 2.0.x installed in your machine but tensorflowf.contrib no longer exists in tensorflow 2.0.x, it was there in Tensorflow 1.x

from chatbot-rnn.

wmodes avatar wmodes commented on June 26, 2024

Any suggestions for using Tensorflow 2.x?

from chatbot-rnn.

Alyetama avatar Alyetama commented on June 26, 2024

Any suggestions for using Tensorflow 2.x?

  • First, install tensorflow_addons:
pip install tensorflow-addons

Option 1:

  • Run the following script in the repository's directory:
from glob import glob

def update(find, replacement):
    for file in glob('*.py'):
        with open(file) as f:
            s = f.read().replace(find, replacement)
        with open(file, 'w') as f:
            f.write(s)

update('import tensorflow as tf', '''import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import tensorflow_addons as tfa''')
update('tf.contrib.rnn.LSTMStateTuple', 'tf.compat.v1.nn.rnn_cell.LSTMStateTuple')
update('from tensorflow.contrib import rnn', '')
update('rnn.NASCell', 'tfa.rnn.NASCell')

Option 2:

  • Clone my fork, which is compatible with TensorFlow v2.x:
git clone https://github.com/Alyetama/chatbot-rnn.git

from chatbot-rnn.

breadbrowser avatar breadbrowser commented on June 26, 2024

pip install tensorflow==1.15

from chatbot-rnn.

breadbrowser avatar breadbrowser commented on June 26, 2024

is all you need to do

from chatbot-rnn.

breadbrowser avatar breadbrowser commented on June 26, 2024

no editing

from chatbot-rnn.

breadbrowser avatar breadbrowser commented on June 26, 2024

needed

from chatbot-rnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.