0

Here's my code:

import numpy
import sys
import nltk
nltk.download('stopwords')
from nltk.tokenize import word_tokenize
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
from keras.models import Sequential
from keras.layers import Dense, Dropout, LSTM
from keras.utils import np_utils
from keras.callbacks import ModelCheckpoint
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential, load_model

model = Sequential()
model.add(LSTM(256, input_shape=(X.shape[1], X.shape[2]), return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(256, return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(128))
model.add(Dropout(0.2))
model.add(Dense(y.shape[1], activation='softmax'))

Can anyone Please tell me where did I go Wrong (It's a long code, I haven't attached everything over here). Please let me know if I should attach the full code

  • Welcome to Stackoverflow. Try to create a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) – Molitoris Mar 30 '21 at 09:12
  • Here you are mixing imports from `keras` and `tensorflow`. You can change the imports from `keras.*` to `tensorflow.keras.*` issue will be resolved. For more details you can refer [this](https://stackoverflow.com/questions/55496289/how-to-fix-attributeerror-module-tensorflow-has-no-attribute-get-default-gr),Thanks! –  Apr 16 '21 at 12:46

0 Answers0