预训练好的:
模型代码:
[......]
device = "cuda" if torch.cuda.is_available() else "cpu"
print(device)
# create data
weight = 0.6
bias = 0.4
start = 0
end = 1
ste[......]
import numpy as np
import pandas as pd
df = pd.read_csv('./smsspamcollection.tsv', sep='\t')
df.head()
df['label'].value_counts()
# split data set
from sklearn.model_selection import train_test_split
X = df['message']
y = df['label']
df.[......]
1 机器准备
GCP,GPU至少选Tesla T4、操作系统Ubuntu 20.04,硬盘50GB
2 安装cuda驱动
参考GCP的官方文档:https://cloud.google.com/compute/docs/gpus/install-drivers-gpu
可以使用自动安装脚本(注意提前安装python 3)
下载
curl https://raw.githubusercontent.com/GoogleCloudPlatform/compute-gp[......]