I am learning Machine Learning and AI and looking at a code written about 2-3 years back. Here is part of the code where I a facing issue:
import pandas as pd
import numpy as np
import random
import time
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import RobustScaler
import tensorflow as tf
from tensorflow.keras.layers import CuDNNLSTM,Dropout,Dense,Input,add
When I run using the above code I get the following error:
ImportError: cannot import name 'CuDNNLSTM' from 'tensorflow.keras.layers'
When I searched for solution I got the following suggestion:
from tensorflow.compat.v1.keras.layers import CuDNNLSTM
So I added the above line and removed CuDNNLSTM from the previous import line. Now I get his error:
ModuleNotFoundError: No module named 'tensorflow.compat.v1.keras'
Can I get help to solve the above issue?
Here is the extract of the code where CuDNNLSTM is used.
inputs = Input(shape=(240,1))
x = CuDNNLSTM(25,return_sequences=False)(inputs)
x = Dropout(0.1)(x)