Open akarthik2014 opened 4 years ago
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
Any suggestions for using Tensorflow 2.x?
Any suggestions for using Tensorflow 2.x?
tensorflow_addons
:
pip install tensorflow-addons
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')
git clone https://github.com/Alyetama/chatbot-rnn.git
pip install tensorflow==1.15
is all you need to do
no editing
needed
Exception has occurred: ModuleNotFoundError No module named 'tensorflow.contrib'