fastdeploy uie模型部署单进程推理测试

961 阅读22分钟

安装paddle fastdeploy组件

pip install numpy opencv-python fastdeploy-gpu-python -f https://www.paddlepaddle.org.cn/whl/fastdeploy.html

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Looking in links: https://www.paddlepaddle.org.cn/whl/fastdeploy.html
Requirement already satisfied: numpy in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (1.19.5)
Requirement already satisfied: opencv-python in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (4.6.0.66)
Collecting fastdeploy-gpu-python
  Downloading https://bj.bcebos.com/fastdeploy/release/wheels/fastdeploy_gpu_python-1.0.1-cp37-cp37m-manylinux1_x86_64.whl (1683.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 GB 480.6 kB/s eta 0:00:000:0100:02
[?25hRequirement already satisfied: requests in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from fastdeploy-gpu-python) (2.24.0)
Requirement already satisfied: tqdm in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from fastdeploy-gpu-python) (4.64.1)
Requirement already satisfied: pyyaml in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from fastdeploy-gpu-python) (5.1.2)
Requirement already satisfied: wheel in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from fastdeploy-gpu-python) (0.36.2)
Collecting fastdeploy-tools==0.0.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/08/df/82b5f2d0eed4fa0ef733a7c201f18dd4eaf171eebc0b231bbdf5b0d23566/fastdeploy_tools-0.0.1-py3-none-any.whl (9.0 kB)
Requirement already satisfied: chardet<4,>=3.0.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->fastdeploy-gpu-python) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->fastdeploy-gpu-python) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->fastdeploy-gpu-python) (2019.9.11)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->fastdeploy-gpu-python) (1.25.11)
Installing collected packages: fastdeploy-tools, fastdeploy-gpu-python
Successfully installed fastdeploy-gpu-python-1.0.1 fastdeploy-tools-0.0.1

[notice] A new release of pip available: 22.1.2 -> 22.3.1
[notice] To update, run: pip install --upgrade pip
Note: you may need to restart the kernel to use updated packages.

paddle uie 原生推理

from pprint import pprint
from paddlenlp import Taskflow
from tqdm import tqdm
schema = ['事件']
# 设定抽取目标和定制化模型权重路径
my_ie = Taskflow("information_extraction", schema=schema, task_path='./checkpoint/model_best')
for i in tqdm(range(1000)):

    my_ie("2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!")

gpu推理速度 1秒 61条

[2022-12-20 14:11:27,426] [    INFO] - We are using <class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'> to load './checkpoint/model_best'.
100%|██████████| 1000/1000 [00:16<00:00, 61.09it/s]

cpu环境初始化uie模型

import fastdeploy
from fastdeploy.text import UIEModel
import os
model_dir = "export"
# "paddlenlp/uie/uie-tiny/vocab.txt"
model_path = os.path.join(model_dir, "inference.pdmodel")
param_path = os.path.join(model_dir, "inference.pdiparams")
vocab_path = os.path.join('uie-base', "vocab.txt")

runtime_option = fastdeploy.RuntimeOption()
schema = ["事件"]

# 初始化UIE模型
uie = UIEModel(
    model_path,
    param_path,
    vocab_path,
    position_prob=0.5,
    max_length=128,
    schema=schema,
    runtime_option=runtime_option)
[INFO] fastdeploy/runtime.cc(500)::Init    Runtime initialized with Backend::ORT in Device::CPU.

paddle fastdeploy推理demo

from pprint import pprint
results = uie.predict(
        ["2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!"], return_dict=True)
pprint(results)
[{'事件': {'end': 43,         'probability': 0.991473913192749,         'start': 24,         'text': '中国选手谷爱凌以188.25分获得金牌'}}]

同一条数据推理100次

from tqdm import tqdm
for i in tqdm(range(100)):
    results = uie.predict(
        ["2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!"], return_dict=True)

得到cpu推理速度为4条/s

100%|██████████| 100/100 [00:23<00:00,  4.33it/s]

用gpu作为推理硬件进行模型初始化

import fastdeploy
from fastdeploy.text import UIEModel
import os
model_dir = "export"
# "paddlenlp/uie/uie-tiny/vocab.txt"
model_path = os.path.join(model_dir, "inference.pdmodel")
param_path = os.path.join(model_dir, "inference.pdiparams")
vocab_path = os.path.join('uie-base', "vocab.txt")

runtime_option = fastdeploy.RuntimeOption()
runtime_option.use_gpu()

schema = ["事件"]

# 初始化UIE模型
uie = UIEModel(
    model_path,
    param_path,
    vocab_path,
    position_prob=0.5,
    max_length=128,
    schema=schema,
    runtime_option=runtime_option)
[INFO] fastdeploy/runtime.cc(500)::Init    Runtime initialized with Backend::ORT in Device::GPU.

对1000条样本进行单线程推理速度测试

from tqdm import tqdm
for i in tqdm(range(1000)):
    results = uie.predict(
        ["2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!"], return_dict=True)

gpu单进程推理速度为1s269条

100%|██████████| 1000/1000 [00:03<00:00, 269.01it/s]

gpu硬件ort推理框架模型初始化

import fastdeploy
from fastdeploy.text import UIEModel
import os
model_dir = "export"
# "paddlenlp/uie/uie-tiny/vocab.txt"
model_path = os.path.join(model_dir, "inference.pdmodel")
param_path = os.path.join(model_dir, "inference.pdiparams")
vocab_path = os.path.join('uie-base', "vocab.txt")

runtime_option = fastdeploy.RuntimeOption()
runtime_option.use_gpu()
runtime_option.use_ort_backend()

schema = ["事件"]

# 初始化UIE模型
uie = UIEModel(
    model_path,
    param_path,
    vocab_path,
    position_prob=0.5,
    max_length=128,
    schema=schema,
    runtime_option=runtime_option)
[INFO] fastdeploy/runtime.cc(500)::Init    Runtime initialized with Backend::ORT in Device::GPU.
from tqdm import tqdm
for i in tqdm(range(1000)):
    results = uie.predict(
        ["2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!"], return_dict=True)

推理速度为1s265条

100%|██████████| 1000/1000 [00:03<00:00, 265.36it/s]

gpu硬件 paddle infer推理框架初始化模型

import fastdeploy
from fastdeploy.text import UIEModel
import os
model_dir = "export"
# "paddlenlp/uie/uie-tiny/vocab.txt"
model_path = os.path.join(model_dir, "inference.pdmodel")
param_path = os.path.join(model_dir, "inference.pdiparams")
vocab_path = os.path.join('uie-base', "vocab.txt")

runtime_option = fastdeploy.RuntimeOption()
runtime_option.use_gpu()
runtime_option.use_paddle_infer_backend()

schema = ["事件"]

# 初始化UIE模型
uie = UIEModel(
    model_path,
    param_path,
    vocab_path,
    position_prob=0.5,
    max_length=128,
    schema=schema,
    runtime_option=runtime_option)
[INFO] fastdeploy/runtime.cc(517)::Init    Runtime initialized with Backend::PDINFER in Device::GPU.
from tqdm import tqdm
for i in tqdm(range(1000)):
    results = uie.predict(
        ["2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!"], return_dict=True)

推理速度为1秒333条

100%|██████████| 1000/1000 [00:02<00:00, 333.47it/s]

gpu硬件 trt推理框架

import fastdeploy
from fastdeploy.text import UIEModel
import os
model_dir = "export"
# "paddlenlp/uie/uie-tiny/vocab.txt"
model_path = os.path.join(model_dir, "inference.pdmodel")
param_path = os.path.join(model_dir, "inference.pdiparams")
vocab_path = os.path.join('uie-base', "vocab.txt")

runtime_option = fastdeploy.RuntimeOption()
runtime_option.use_gpu()
runtime_option.use_trt_backend()

schema = ["事件"]

# 初始化UIE模型
uie = UIEModel(
    model_path,
    param_path,
    vocab_path,
    position_prob=0.5,
    max_length=128,
    schema=schema,
    runtime_option=runtime_option)

推理速度为1秒389条

100%|██████████| 1000/1000 [00:02<00:00, 389.99it/s]

将doccano导出的实体关系数据集转换为uie的训练数据集格式

!python doccano.py \
    --doccano_file ../predict_sentence_2019_all.jsonl \
    --task_type ext \
    --save_dir ./predict_sentence_2019 \
    --splits 0.8 0.2 0
[2022-12-19 18:20:31,401] [    INFO] - Converting doccano data...100%|████████████████████████████████████| 13488/13488 [00:14<00:00, 900.22it/s]
[2022-12-19 18:20:46,387] [    INFO] - Adding negative samples for first stage prompt...100%|█████████████████████████████████| 13488/13488 [00:00<00:00, 382809.74it/s]
[2022-12-19 18:20:46,423] [    INFO] - Adding negative samples for second stage prompt...100%|█████████████████████████████████████| 13488/13488 [03:44<00:00, 60.05it/s]
[2022-12-19 18:24:31,129] [    INFO] - Converting doccano data...100%|█████████████████████████████████████| 3373/3373 [00:01<00:00, 1914.75it/s]
[2022-12-19 18:24:32,892] [    INFO] - Adding negative samples for first stage prompt...100%|███████████████████████████████████| 3373/3373 [00:00<00:00, 326956.03it/s]
[2022-12-19 18:24:32,903] [    INFO] - Adding negative samples for second stage prompt...100%|███████████████████████████████████| 3373/3373 [00:00<00:00, 542502.78it/s]
[2022-12-19 18:24:32,915] [    INFO] - Converting doccano data...0it [00:00, ?it/s]
[2022-12-19 18:24:32,915] [    INFO] - Adding negative samples for first stage prompt...0it [00:00, ?it/s]
[2022-12-19 18:24:33,999] [    INFO] - Save 142026 examples to ./predict_sentence_2019/train.txt.[2022-12-19 18:24:34,085] [    INFO] - Save 8805 examples to ./predict_sentence_2019/dev.txt.[2022-12-19 18:24:34,086] [    INFO] - Save 0 examples to ./predict_sentence_2019/test.txt.[2022-12-19 18:24:34,086] [    INFO] - Finished! It takes 242.74 seconds

进行实体关系抽取训练

!python finetune.py \
    --train_path ./predict_sentence_2019_5000/train.txt \
    --dev_path ./predict_sentence_2019_5000/dev.txt \
    --save_dir ./checkpoint \
    --learning_rate 1e-5 \
    --batch_size 16 \
    --max_seq_len 128 \
    --num_epochs 100 \
    --model uie-base \
    --seed 1000 \
    --logging_steps 10 \
    --valid_steps 100 \
    --device gpu
[2022-12-20 10:54:12,398] [    INFO] - Downloading resource files...
[2022-12-20 10:54:12,404] [    INFO] - We are using <class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'> to load 'uie-base'.
W1220 10:54:12.434456  8350 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 11.2
W1220 10:54:12.438351  8350 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2.
[2022-12-20 10:54:19,320] [    INFO] - global step 10, epoch: 1, loss: 0.02942, speed: 3.98 step/s
[2022-12-20 10:54:20,688] [    INFO] - global step 20, epoch: 1, loss: 0.01943, speed: 7.31 step/s
[2022-12-20 10:54:22,047] [    INFO] - global step 30, epoch: 1, loss: 0.01534, speed: 7.36 step/s
[2022-12-20 10:54:23,406] [    INFO] - global step 40, epoch: 1, loss: 0.01344, speed: 7.36 step/s
[2022-12-20 10:54:24,769] [    INFO] - global step 50, epoch: 1, loss: 0.01169, speed: 7.34 step/s
[2022-12-20 10:54:26,125] [    INFO] - global step 60, epoch: 1, loss: 0.01105, speed: 7.38 step/s
[2022-12-20 10:54:27,479] [    INFO] - global step 70, epoch: 1, loss: 0.01027, speed: 7.39 step/s
[2022-12-20 10:54:28,827] [    INFO] - global step 80, epoch: 1, loss: 0.00971, speed: 7.42 step/s
[2022-12-20 10:54:30,204] [    INFO] - global step 90, epoch: 1, loss: 0.00902, speed: 7.26 step/s
[2022-12-20 10:54:31,609] [    INFO] - global step 100, epoch: 1, loss: 0.00869, speed: 7.12 step/s
[2022-12-20 10:54:44,957] [    INFO] - Evaluation precision: 0.58994, recall: 0.47461, F1: 0.52603
[2022-12-20 10:54:44,957] [    INFO] - best F1 performence has been updated: 0.00000 --> 0.52603
[2022-12-20 10:54:50,688] [    INFO] - global step 110, epoch: 1, loss: 0.00847, speed: 7.22 step/s
[2022-12-20 10:54:52,050] [    INFO] - global step 120, epoch: 1, loss: 0.00813, speed: 7.34 step/s
[2022-12-20 10:54:53,417] [    INFO] - global step 130, epoch: 1, loss: 0.00797, speed: 7.32 step/s
[2022-12-20 10:54:54,769] [    INFO] - global step 140, epoch: 1, loss: 0.00760, speed: 7.40 step/s
[2022-12-20 10:54:56,118] [    INFO] - global step 150, epoch: 1, loss: 0.00744, speed: 7.42 step/s
[2022-12-20 10:54:57,487] [    INFO] - global step 160, epoch: 1, loss: 0.00728, speed: 7.30 step/s
[2022-12-20 10:54:58,854] [    INFO] - global step 170, epoch: 1, loss: 0.00705, speed: 7.32 step/s
[2022-12-20 10:55:00,236] [    INFO] - global step 180, epoch: 1, loss: 0.00687, speed: 7.24 step/s
[2022-12-20 10:55:01,609] [    INFO] - global step 190, epoch: 1, loss: 0.00679, speed: 7.28 step/s
[2022-12-20 10:55:02,979] [    INFO] - global step 200, epoch: 1, loss: 0.00660, speed: 7.30 step/s
[2022-12-20 10:55:16,438] [    INFO] - Evaluation precision: 0.64812, recall: 0.59651, F1: 0.62124
[2022-12-20 10:55:16,438] [    INFO] - best F1 performence has been updated: 0.52603 --> 0.62124
[2022-12-20 10:55:22,128] [    INFO] - global step 210, epoch: 1, loss: 0.00646, speed: 7.40 step/s
[2022-12-20 10:55:23,495] [    INFO] - global step 220, epoch: 1, loss: 0.00637, speed: 7.31 step/s
[2022-12-20 10:55:24,850] [    INFO] - global step 230, epoch: 1, loss: 0.00630, speed: 7.38 step/s
[2022-12-20 10:55:26,221] [    INFO] - global step 240, epoch: 1, loss: 0.00628, speed: 7.29 step/s
[2022-12-20 10:55:27,604] [    INFO] - global step 250, epoch: 1, loss: 0.00617, speed: 7.23 step/s
[2022-12-20 10:55:28,977] [    INFO] - global step 260, epoch: 1, loss: 0.00602, speed: 7.29 step/s
[2022-12-20 10:55:30,401] [    INFO] - global step 270, epoch: 1, loss: 0.00598, speed: 7.02 step/s
[2022-12-20 10:55:31,778] [    INFO] - global step 280, epoch: 1, loss: 0.00591, speed: 7.27 step/s
[2022-12-20 10:55:33,155] [    INFO] - global step 290, epoch: 1, loss: 0.00576, speed: 7.26 step/s
[2022-12-20 10:55:34,520] [    INFO] - global step 300, epoch: 1, loss: 0.00570, speed: 7.33 step/s
[2022-12-20 10:55:47,771] [    INFO] - Evaluation precision: 0.72783, recall: 0.60948, F1: 0.66342
[2022-12-20 10:55:47,772] [    INFO] - best F1 performence has been updated: 0.62124 --> 0.66342
[2022-12-20 10:56:56,361] [    INFO] - global step 510, epoch: 1, loss: 0.00485, speed: 7.23 step/s
[2022-12-20 10:56:57,723] [    INFO] - global step 520, epoch: 1, loss: 0.00483, speed: 7.34 step/s
[2022-12-20 10:56:59,086] [    INFO] - global step 530, epoch: 1, loss: 0.00480, speed: 7.34 step/s
[2022-12-20 10:57:00,496] [    INFO] - global step 540, epoch: 1, loss: 0.00478, speed: 7.09 step/s
[2022-12-20 10:57:01,889] [    INFO] - global step 550, epoch: 1, loss: 0.00476, speed: 7.18 step/s
[2022-12-20 10:57:03,286] [    INFO] - global step 560, epoch: 1, loss: 0.00473, speed: 7.16 step/s
[2022-12-20 10:57:04,653] [    INFO] - global step 570, epoch: 1, loss: 0.00471, speed: 7.32 step/s
[2022-12-20 10:57:06,031] [    INFO] - global step 580, epoch: 1, loss: 0.00471, speed: 7.26 step/s
[2022-12-20 10:57:07,404] [    INFO] - global step 590, epoch: 1, loss: 0.00468, speed: 7.29 step/s
[2022-12-20 10:57:08,793] [    INFO] - global step 600, epoch: 1, loss: 0.00464, speed: 7.20 step/s
[2022-12-20 10:57:22,083] [    INFO] - Evaluation precision: 0.74926, recall: 0.67770, F1: 0.71169
[2022-12-20 10:57:23,446] [    INFO] - global step 610, epoch: 1, loss: 0.00463, speed: 7.34 step/s
[2022-12-20 10:57:24,825] [    INFO] - global step 620, epoch: 1, loss: 0.00461, speed: 7.26 step/s
[2022-12-20 10:57:26,185] [    INFO] - global step 630, epoch: 1, loss: 0.00460, speed: 7.35 step/s
[2022-12-20 10:57:27,543] [    INFO] - global step 640, epoch: 1, loss: 0.00456, speed: 7.36 step/s
[2022-12-20 10:57:28,942] [    INFO] - global step 650, epoch: 1, loss: 0.00454, speed: 7.15 step/s
[2022-12-20 10:57:30,345] [    INFO] - global step 660, epoch: 1, loss: 0.00451, speed: 7.13 step/s
[2022-12-20 10:57:31,744] [    INFO] - global step 670, epoch: 1, loss: 0.00452, speed: 7.15 step/s
[2022-12-20 10:57:33,120] [    INFO] - global step 680, epoch: 1, loss: 0.00449, speed: 7.27 step/s
[2022-12-20 10:57:34,495] [    INFO] - global step 690, epoch: 1, loss: 0.00447, speed: 7.27 step/s
[2022-12-20 10:57:35,883] [    INFO] - global step 700, epoch: 1, loss: 0.00444, speed: 7.21 step/s
[2022-12-20 10:57:49,044] [    INFO] - Evaluation precision: 0.75508, recall: 0.69783, F1: 0.72533
[2022-12-20 10:57:49,044] [    INFO] - best F1 performence has been updated: 0.71597 --> 0.72533
[2022-12-20 10:57:54,803] [    INFO] - global step 710, epoch: 1, loss: 0.00442, speed: 6.85 step/s
[2022-12-20 10:57:56,193] [    INFO] - global step 720, epoch: 1, loss: 0.00440, speed: 7.20 step/s
[2022-12-20 10:57:57,550] [    INFO] - global step 730, epoch: 1, loss: 0.00437, speed: 7.37 step/s
[2022-12-20 10:57:58,928] [    INFO] - global step 740, epoch: 1, loss: 0.00437, speed: 7.26 step/s
[2022-12-20 10:58:00,332] [    INFO] - global step 750, epoch: 1, loss: 0.00436, speed: 7.12 step/s
[2022-12-20 10:58:01,710] [    INFO] - global step 760, epoch: 1, loss: 0.00435, speed: 7.26 step/s
[2022-12-20 10:58:03,080] [    INFO] - global step 770, epoch: 1, loss: 0.00434, speed: 7.30 step/s
[2022-12-20 10:58:04,486] [    INFO] - global step 780, epoch: 1, loss: 0.00431, speed: 7.12 step/s
[2022-12-20 10:58:05,854] [    INFO] - global step 790, epoch: 1, loss: 0.00432, speed: 7.31 step/s
[2022-12-20 10:58:07,244] [    INFO] - global step 800, epoch: 1, loss: 0.00430, speed: 7.19 step/s
[2022-12-20 10:58:20,532] [    INFO] - Evaluation precision: 0.70029, recall: 0.74525, F1: 0.72207
[2022-12-20 10:58:21,901] [    INFO] - global step 810, epoch: 1, loss: 0.00429, speed: 7.30 step/s
[2022-12-20 10:58:23,272] [    INFO] - global step 820, epoch: 1, loss: 0.00427, speed: 7.30 step/s
[2022-12-20 10:58:24,660] [    INFO] - global step 830, epoch: 1, loss: 0.00426, speed: 7.21 step/s
[2022-12-20 10:58:26,043] [    INFO] - global step 840, epoch: 1, loss: 0.00423, speed: 7.23 step/s
[2022-12-20 10:58:27,431] [    INFO] - global step 850, epoch: 1, loss: 0.00421, speed: 7.20 step/s
[2022-12-20 10:58:28,814] [    INFO] - global step 860, epoch: 1, loss: 0.00419, speed: 7.23 step/s
[2022-12-20 10:58:30,220] [    INFO] - global step 870, epoch: 1, loss: 0.00418, speed: 7.11 step/s
[2022-12-20 10:58:31,575] [    INFO] - global step 880, epoch: 1, loss: 0.00416, speed: 7.38 step/s
[2022-12-20 10:58:32,967] [    INFO] - global step 890, epoch: 1, loss: 0.00415, speed: 7.19 step/s
[2022-12-20 10:58:34,337] [    INFO] - global step 900, epoch: 1, loss: 0.00412, speed: 7.30 step/s
[2022-12-20 10:58:47,419] [    INFO] - Evaluation precision: 0.79168, recall: 0.68083, F1: 0.73208
[2022-12-20 10:58:47,419] [    INFO] - best F1 performence has been updated: 0.72533 --> 0.73208
[2022-12-20 10:58:53,136] [    INFO] - global step 910, epoch: 1, loss: 0.00410, speed: 7.15 step/s
[2022-12-20 10:58:54,512] [    INFO] - global step 920, epoch: 1, loss: 0.00409, speed: 7.27 step/s
[2022-12-20 10:58:55,903] [    INFO] - global step 930, epoch: 1, loss: 0.00406, speed: 7.19 step/s
[2022-12-20 10:58:57,304] [    INFO] - global step 940, epoch: 1, loss: 0.00406, speed: 7.14 step/s
[2022-12-20 10:58:58,685] [    INFO] - global step 950, epoch: 1, loss: 0.00405, speed: 7.25 step/s
[2022-12-20 10:59:00,115] [    INFO] - global step 960, epoch: 1, loss: 0.00403, speed: 6.99 step/s
[2022-12-20 10:59:01,545] [    INFO] - global step 970, epoch: 1, loss: 0.00401, speed: 6.99 step/s
[2022-12-20 10:59:02,922] [    INFO] - global step 980, epoch: 1, loss: 0.00400, speed: 7.27 step/s
[2022-12-20 10:59:04,314] [    INFO] - global step 990, epoch: 1, loss: 0.00399, speed: 7.18 step/s
[2022-12-20 10:59:05,696] [    INFO] - global step 1000, epoch: 1, loss: 0.00398, speed: 7.24 step/s
[2022-12-20 10:59:18,860] [    INFO] - Evaluation precision: 0.78986, recall: 0.71796, F1: 0.75220
[2022-12-20 10:59:18,860] [    INFO] - best F1 performence has been updated: 0.73208 --> 0.75220
[2022-12-20 10:59:24,501] [    INFO] - global step 1010, epoch: 1, loss: 0.00396, speed: 7.31 step/s
[2022-12-20 10:59:25,861] [    INFO] - global step 1020, epoch: 1, loss: 0.00396, speed: 7.36 step/s
[2022-12-20 10:59:27,249] [    INFO] - global step 1030, epoch: 1, loss: 0.00396, speed: 7.20 step/s
[2022-12-20 10:59:28,625] [    INFO] - global step 1040, epoch: 1, loss: 0.00395, speed: 7.27 step/s
[2022-12-20 10:59:30,007] [    INFO] - global step 1050, epoch: 1, loss: 0.00393, speed: 7.24 step/s
[2022-12-20 10:59:31,425] [    INFO] - global step 1060, epoch: 1, loss: 0.00391, speed: 7.05 step/s
[2022-12-20 10:59:32,803] [    INFO] - global step 1070, epoch: 1, loss: 0.00390, speed: 7.26 step/s
[2022-12-20 10:59:34,190] [    INFO] - global step 1080, epoch: 1, loss: 0.00389, speed: 7.21 step/s
[2022-12-20 10:59:35,568] [    INFO] - global step 1090, epoch: 1, loss: 0.00387, speed: 7.26 step/s
[2022-12-20 10:59:36,941] [    INFO] - global step 1100, epoch: 1, loss: 0.00385, speed: 7.28 step/s
[2022-12-20 10:59:50,140] [    INFO] - Evaluation precision: 0.80584, recall: 0.70365, F1: 0.75128
[2022-12-20 10:59:51,528] [    INFO] - global step 1110, epoch: 1, loss: 0.00384, speed: 7.21 step/s
[2022-12-20 10:59:52,906] [    INFO] - global step 1120, epoch: 1, loss: 0.00383, speed: 7.26 step/s
[2022-12-20 10:59:54,298] [    INFO] - global step 1130, epoch: 1, loss: 0.00384, speed: 7.18 step/s
[2022-12-20 10:59:55,695] [    INFO] - global step 1140, epoch: 1, loss: 0.00382, speed: 7.16 step/s
[2022-12-20 10:59:57,129] [    INFO] - global step 1150, epoch: 1, loss: 0.00382, speed: 6.98 step/s
[2022-12-20 10:59:58,539] [    INFO] - global step 1160, epoch: 1, loss: 0.00381, speed: 7.09 step/s
[2022-12-20 11:00:00,033] [    INFO] - global step 1170, epoch: 1, loss: 0.00380, speed: 6.69 step/s
[2022-12-20 11:00:01,438] [    INFO] - global step 1180, epoch: 1, loss: 0.00379, speed: 7.12 step/s
[2022-12-20 11:00:02,858] [    INFO] - global step 1190, epoch: 1, loss: 0.00379, speed: 7.04 step/s
[2022-12-20 11:00:04,236] [    INFO] - global step 1200, epoch: 1, loss: 0.00378, speed: 7.26 step/s
[2022-12-20 11:00:17,531] [    INFO] - Evaluation precision: 0.79272, recall: 0.71080, F1: 0.74953
[2022-12-20 11:00:18,945] [    INFO] - global step 1210, epoch: 1, loss: 0.00377, speed: 7.07 step/s
[2022-12-20 11:00:20,322] [    INFO] - global step 1220, epoch: 1, loss: 0.00375, speed: 7.27 step/s
[2022-12-20 11:00:21,701] [    INFO] - global step 1230, epoch: 1, loss: 0.00375, speed: 7.25 step/s
[2022-12-20 11:00:23,096] [    INFO] - global step 1240, epoch: 1, loss: 0.00374, speed: 7.17 step/s
[2022-12-20 11:00:24,468] [    INFO] - global step 1250, epoch: 1, loss: 0.00374, speed: 7.29 step/s
[2022-12-20 11:00:25,838] [    INFO] - global step 1260, epoch: 1, loss: 0.00374, speed: 7.30 step/s
[2022-12-20 11:00:27,219] [    INFO] - global step 1270, epoch: 1, loss: 0.00374, speed: 7.24 step/s
[2022-12-20 11:00:28,601] [    INFO] - global step 1280, epoch: 1, loss: 0.00373, speed: 7.24 step/s
[2022-12-20 11:00:30,028] [    INFO] - global step 1290, epoch: 1, loss: 0.00373, speed: 7.01 step/s
[2022-12-20 11:00:31,493] [    INFO] - global step 1300, epoch: 1, loss: 0.00372, speed: 6.83 step/s
[2022-12-20 11:00:44,750] [    INFO] - Evaluation precision: 0.75505, recall: 0.76873, F1: 0.76183
[2022-12-20 11:00:44,750] [    INFO] - best F1 performence has been updated: 0.75220 --> 0.76183
[2022-12-20 11:00:50,433] [    INFO] - global step 1310, epoch: 1, loss: 0.00371, speed: 7.18 step/s
[2022-12-20 11:00:51,831] [    INFO] - global step 1320, epoch: 1, loss: 0.00372, speed: 7.16 step/s
[2022-12-20 11:00:53,196] [    INFO] - global step 1330, epoch: 1, loss: 0.00371, speed: 7.32 step/s
[2022-12-20 11:00:54,552] [    INFO] - global step 1340, epoch: 1, loss: 0.00371, speed: 7.38 step/s
[2022-12-20 11:00:55,937] [    INFO] - global step 1350, epoch: 1, loss: 0.00370, speed: 7.22 step/s
[2022-12-20 11:00:57,359] [    INFO] - global step 1360, epoch: 1, loss: 0.00369, speed: 7.04 step/s
[2022-12-20 11:00:58,754] [    INFO] - global step 1370, epoch: 1, loss: 0.00367, speed: 7.17 step/s
[2022-12-20 11:01:00,192] [    INFO] - global step 1380, epoch: 1, loss: 0.00367, speed: 6.96 step/s
[2022-12-20 11:01:01,578] [    INFO] - global step 1390, epoch: 1, loss: 0.00366, speed: 7.22 step/s
[2022-12-20 11:01:02,969] [    INFO] - global step 1400, epoch: 1, loss: 0.00366, speed: 7.19 step/s
[2022-12-20 11:01:16,201] [    INFO] - Evaluation precision: 0.79290, recall: 0.73898, F1: 0.76499
[2022-12-20 11:01:16,201] [    INFO] - best F1 performence has been updated: 0.76183 --> 0.76499
[2022-12-20 11:01:21,892] [    INFO] - global step 1410, epoch: 1, loss: 0.00364, speed: 7.16 step/s
[2022-12-20 11:01:23,246] [    INFO] - global step 1420, epoch: 1, loss: 0.00364, speed: 7.39 step/s
[2022-12-20 11:01:24,614] [    INFO] - global step 1430, epoch: 1, loss: 0.00364, speed: 7.31 step/s
[2022-12-20 11:01:25,991] [    INFO] - global step 1440, epoch: 1, loss: 0.00363, speed: 7.26 step/s
[2022-12-20 11:01:27,376] [    INFO] - global step 1450, epoch: 1, loss: 0.00362, speed: 7.22 step/s
[2022-12-20 11:01:28,747] [    INFO] - global step 1460, epoch: 1, loss: 0.00361, speed: 7.30 step/s
[2022-12-20 11:01:30,130] [    INFO] - global step 1470, epoch: 1, loss: 0.00360, speed: 7.23 step/s
[2022-12-20 11:01:31,557] [    INFO] - global step 1480, epoch: 1, loss: 0.00359, speed: 7.01 step/s
[2022-12-20 11:01:32,933] [    INFO] - global step 1490, epoch: 1, loss: 0.00360, speed: 7.27 step/s
[2022-12-20 11:01:34,374] [    INFO] - global step 1500, epoch: 1, loss: 0.00359, speed: 6.94 step/s
[2022-12-20 11:01:47,951] [    INFO] - Evaluation precision: 0.76854, recall: 0.76493, F1: 0.76673
[2022-12-20 11:01:47,952] [    INFO] - best F1 performence has been updated: 0.76499 --> 0.76673

用uie-tiny进行实体关系抽取训练

!python finetune.py \
    --train_path ./predict_sentence_2019_all/train.txt \
    --dev_path ./predict_sentence_2019_all/dev.txt \
    --save_dir ./checkpoint \
    --learning_rate 1e-5 \
    --batch_size 16 \
    --max_seq_len 128 \
    --num_epochs 100 \
    --model uie-tiny \
    --seed 1000 \
    --logging_steps 10 \
    --valid_steps 100 \
    --device gpu

安装特定版本paddle nlp组件

pip install paddlenlp==2.3.4
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting paddlenlp==2.3.4
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8e/e1/94cdbaca400a57687a8529213776468f003b64b6e35a6f4acf6b6539f543/paddlenlp-2.3.4-py3-none-any.whl (1.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 5.2 MB/s eta 0:00:00a 0:00:01
[?25hRequirement already satisfied: jieba in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (0.42.1)
Requirement already satisfied: dill<0.3.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (0.3.3)
Requirement already satisfied: seqeval in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (1.2.2)
Requirement already satisfied: multiprocess<=0.70.12.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (0.70.11.1)
Collecting datasets>=2.0.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/24/57/6b07e4dc51479ae3e9bbc774af348b0307e2b66957ceae94d25e3f9d7dcf/datasets-2.8.0-py3-none-any.whl (452 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 452.9/452.9 kB 1.6 MB/s eta 0:00:00a 0:00:01
[?25hRequirement already satisfied: protobuf<=3.20.0,>=3.1.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (3.20.0)
Requirement already satisfied: colorama in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (0.4.4)
Requirement already satisfied: sentencepiece in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (0.1.96)
Requirement already satisfied: colorlog in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (4.1.0)
Requirement already satisfied: paddlefsl in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (1.0.0)
Requirement already satisfied: paddle2onnx in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (1.0.0)
Requirement already satisfied: tqdm in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp==2.3.4) (4.64.1)
Requirement already satisfied: pandas in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from datasets>=2.0.0->paddlenlp==2.3.4) (1.1.5)
Requirement already satisfied: importlib-metadata in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from datasets>=2.0.0->paddlenlp==2.3.4) (4.2.0)
Requirement already satisfied: pyarrow>=6.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from datasets>=2.0.0->paddlenlp==2.3.4) (8.0.0)
Collecting fsspec[http]>=2021.11.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/37/57/eb7c3c10b187d3b8565946772ce0229c79e3c623010eda0aeb5032ff56f4/fsspec-2022.11.0-py3-none-any.whl (139 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.5/139.5 kB 2.9 MB/s eta 0:00:00a 0:00:01
[?25hRequirement already satisfied: numpy>=1.17 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from datasets>=2.0.0->paddlenlp==2.3.4) (1.19.5)
Requirement already satisfied: pyyaml>=5.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from datasets>=2.0.0->paddlenlp==2.3.4) (5.1.2)
Requirement already satisfied: requests>=2.19.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from datasets>=2.0.0->paddlenlp==2.3.4) (2.24.0)
Requirement already satisfied: packaging in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from datasets>=2.0.0->paddlenlp==2.3.4) (21.3)
Collecting responses<0.19
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/79/f3/2b3a6dc5986303b3dd1bbbcf482022acb2583c428cd23f0b6d37b1a1a519/responses-0.18.0-py3-none-any.whl (38 kB)
Collecting aiohttp
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7a/48/7882af39221fee58e33eee6c8e516097e2331334a5937f54fe5b5b285d9e/aiohttp-3.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (948 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 948.0/948.0 kB 6.3 MB/s eta 0:00:0000:0100:01
[?25hCollecting huggingface-hub<1.0.0,>=0.2.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a0/0b/e4c1165bb954036551e61e1d7858e3293347f360d8f84854092f3ad38446/huggingface_hub-0.11.1-py3-none-any.whl (182 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.4/182.4 kB 4.8 MB/s eta 0:00:00a 0:00:01
[?25hCollecting xxhash
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fc/ca/8dd0bcbd592d6f355b75c473f5eedc6b432ffad74ad7c36e16de6bbe68fd/xxhash-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (212 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 213.0/213.0 kB 5.0 MB/s eta 0:00:00a 0:00:01
[?25hRequirement already satisfied: pillow==8.2.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlefsl->paddlenlp==2.3.4) (8.2.0)
Collecting paddlefsl
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fb/4a/25d1959a8f1fe5ee400f32fc9fc8b56d4fd6fc25315e23c0171f6e705e2a/paddlefsl-1.1.0-py3-none-any.whl (101 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.0/101.0 kB 2.8 MB/s eta 0:00:00
[?25hRequirement already satisfied: scikit-learn>=0.21.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from seqeval->paddlenlp==2.3.4) (0.24.2)
Collecting yarl<2.0,>=1.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/02/c6/13751bb69244e4835fa8192a20d1d1110091f717f1e1b0168320ed1a29c9/yarl-1.8.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (231 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 231.4/231.4 kB 5.3 MB/s eta 0:00:00a 0:00:01
[?25hCollecting aiosignal>=1.1.2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/76/ac/a7305707cb852b7e16ff80eaf5692309bde30e2b1100a1fcacdc8f731d97/aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting asynctest==0.13.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e8/b6/8d17e169d577ca7678b11cd0d3ceebb0a6089a7f4a2de4b945fe4b1c86db/asynctest-0.13.0-py3-none-any.whl (26 kB)
Requirement already satisfied: typing-extensions>=3.7.4 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from aiohttp->datasets>=2.0.0->paddlenlp==2.3.4) (4.3.0)
Collecting multidict<7.0,>=4.5
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/72/13/9d0ce330958e8d9ebc8e49fbd0e2e0facab2992182044a2d658558280df0/multidict-6.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (94 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 94.8/94.8 kB 2.7 MB/s eta 0:00:00
[?25hCollecting charset-normalizer<3.0,>=2.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/db/51/a507c856293ab05cdc1db77ff4bc1268ddd39f29e7dc4919aa497f0adbec/charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d6/c1/8991e7c5385b897b8c020cdaad718c5b087a6626d1d11a23e1ea87e325a7/async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Requirement already satisfied: attrs>=17.3.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from aiohttp->datasets>=2.0.0->paddlenlp==2.3.4) (22.1.0)
Collecting frozenlist>=1.1.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b2/18/3b0eb2690b3bf4d340a221d0e76b6c5f4cac9d5dd37fb8c7b6ec25c2f510/frozenlist-1.3.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (148 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 148.0/148.0 kB 3.0 MB/s eta 0:00:00a 0:00:01
[?25hRequirement already satisfied: filelock in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from huggingface-hub<1.0.0,>=0.2.0->datasets>=2.0.0->paddlenlp==2.3.4) (3.0.12)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from packaging->datasets>=2.0.0->paddlenlp==2.3.4) (3.0.9)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests>=2.19.0->datasets>=2.0.0->paddlenlp==2.3.4) (1.25.6)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests>=2.19.0->datasets>=2.0.0->paddlenlp==2.3.4) (2019.9.11)
Requirement already satisfied: chardet<4,>=3.0.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests>=2.19.0->datasets>=2.0.0->paddlenlp==2.3.4) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests>=2.19.0->datasets>=2.0.0->paddlenlp==2.3.4) (2.8)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/56/aa/4ef5aa67a9a62505db124a5cb5262332d1d4153462eb8fd89c9fa41e5d92/urllib3-1.25.11-py2.py3-none-any.whl (127 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128.0/128.0 kB 2.8 MB/s eta 0:00:00a 0:00:01
[?25hRequirement already satisfied: joblib>=0.11 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-learn>=0.21.3->seqeval->paddlenlp==2.3.4) (0.14.1)
Requirement already satisfied: scipy>=0.19.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-learn>=0.21.3->seqeval->paddlenlp==2.3.4) (1.6.3)
Requirement already satisfied: threadpoolctl>=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-learn>=0.21.3->seqeval->paddlenlp==2.3.4) (2.1.0)
Requirement already satisfied: zipp>=0.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from importlib-metadata->datasets>=2.0.0->paddlenlp==2.3.4) (3.8.1)
Requirement already satisfied: python-dateutil>=2.7.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pandas->datasets>=2.0.0->paddlenlp==2.3.4) (2.8.2)
Requirement already satisfied: pytz>=2017.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pandas->datasets>=2.0.0->paddlenlp==2.3.4) (2019.3)
Requirement already satisfied: six>=1.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from python-dateutil>=2.7.3->pandas->datasets>=2.0.0->paddlenlp==2.3.4) (1.16.0)
Installing collected packages: xxhash, urllib3, multidict, fsspec, frozenlist, charset-normalizer, asynctest, async-timeout, yarl, aiosignal, responses, paddlefsl, huggingface-hub, aiohttp, datasets, paddlenlp
  Attempting uninstall: urllib3
    Found existing installation: urllib3 1.25.6
    Uninstalling urllib3-1.25.6:
      Successfully uninstalled urllib3-1.25.6
  Attempting uninstall: paddlefsl
    Found existing installation: paddlefsl 1.0.0
    Uninstalling paddlefsl-1.0.0:
      Successfully uninstalled paddlefsl-1.0.0
  Attempting uninstall: paddlenlp
    Found existing installation: paddlenlp 2.1.1
    Uninstalling paddlenlp-2.1.1:
      Successfully uninstalled paddlenlp-2.1.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
parl 1.4.1 requires pyzmq==18.1.1, but you have pyzmq 23.2.1 which is incompatible.
Successfully installed aiohttp-3.8.3 aiosignal-1.3.1 async-timeout-4.0.2 asynctest-0.13.0 charset-normalizer-2.1.1 datasets-2.8.0 frozenlist-1.3.3 fsspec-2022.11.0 huggingface-hub-0.11.1 multidict-6.0.3 paddlefsl-1.1.0 paddlenlp-2.3.4 responses-0.18.0 urllib3-1.25.11 xxhash-3.1.0 yarl-1.8.2

[notice] A new release of pip available: 22.1.2 -> 22.3.1
[notice] To update, run: pip install --upgrade pip
Note: you may need to restart the kernel to use updated packages.

将动态图模型转换为静态图

# 最佳模型导出
!python export_model.py --model_path ./checkpoint/model_best --output_path ./export

W1220 11:21:21.233268 12298 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 11.2
W1220 11:21:21.237561 12298 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2.