第一步 安装python3.9,3.8到后面不支持第二步 安装依赖pip install torch1.12.0+cu102 torchvision0.13.0+cu102 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu102 -i https://pypi.tuna.tsinghua.edu.cn/
第一步 先安装或者更新驱动,建议使用cu10.2.显卡下载地址:https://www.nvidia.cn/Download/index.aspx如果是更新,需要重启机器第二步 安装依赖的包pip install torch==1.12.0+cu102 torchvision==0.13.0+cu102 torchaudio==0.12.0 --extra-index-url https://do
今天写了一个bert分类的小例子,避免使用bert-service-client,方便实时预测,后续加上从文件中加载训练和测试数据:import numpy as npimport torchfrom pytorch_pretrained_bert import BertTokenizer,BertModel,BertForSequenceClassificationfrom torch.auto
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号