import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
from wordcloud import WordCloud
from bs4 import BeautifulSoup
import re
import nltk
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
from nltk.stem import SnowballStemmer, WordNetLemmatizer
from nltk import sent_tokenize, word_tokenize, pos_tag
from keras.preprocessing import sequence
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Lambda
from keras.layers.embeddings import Embedding
from keras.layers.recurrent import LSTM, SimpleRNN, GRU
from keras.preprocessing.text import Tokenizer
from collections import defaultdict
from keras.layers.convolutional import Convolution1D
from keras import backend as K
from keras.layers.embeddings import Embedding
ModuleNotFoundError Traceback (most recent call last)
Cell In[6], line 37
35 from keras.models import Sequential
36 from keras.layers.core import Dense, Dropout, Activation, Lambda
---> 37 from keras.layers.embeddings import Embedding
38 from keras.layers.recurrent import LSTM, SimpleRNN, GRU
39 from keras.preprocessing.text import Tokenizer
ModuleNotFoundError: No module named 'keras.layers.embeddings'
这些错误不断出现,我不知道如何修复这个模块不fount 'keras.layers.embeddind',我尝试了互联网上的每一件事都不能解决这个问题
1条答案
按热度按时间dgtucam11#
keras.layers.embeddings.Embedding
已移动到keras.layers.Embedding
。您可以按以下方式更新代码: