即使在使用小型数据集后,我在google colab中的 session 仍连续崩溃,显示“使用可用RAM后,您的 session 已崩溃”。
测试尺寸= 99989 * 2
火车尺寸= 299989 * 2
我正在寻找该问题的解决方案,但找不到。
enter code here
corpus = []
for i in range(0, 299989):
SentimentText = re.sub('[^a-zA-Z]', ' ', dataset1['SentimentText'][i])
SentimentText = re.sub('<[^<]+?>', ' ', dataset1['SentimentText'][i])
tokenizer = RegexpTokenizer(r'\w+')
SentimentText = tokenizer.tokenize(SentimentText)
SentimentText = ' '.join(SentimentText)
corpus.append(SentimentText)
X_train = cv.fit_transform(corpus)
from sklearn.feature_extraction import text
X_train = text.TfidfTransformer().fit_transform(X_train)
X_train = X_train.toarray()
y_train = dataset.iloc[:, 1].values
执行完第三部分后,将显示 session 崩溃的错误。
最佳答案
尝试从编辑菜单打开GPU,然后选择笔记本设置
在硬件加速器中选择GPU
这将增加RAM的大小
关于crash - 即使使用较小的数据集后,如何解决使用可用RAM后Google Colab中 session 崩溃的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56535763/