Coder Social home page Coder Social logo

essaykillerbrain / writegpt Goto Github PK

View Code? Open in Web Editor NEW
5.3K 123.0 918.0 206.37 MB

基于开源GPT2.0的初代创作型人工智能 | 可扩展、可进化

License: MIT License

Python 63.12% Shell 0.27% Dockerfile 0.06% C 35.10% C++ 0.38% Java 0.43% Jupyter Notebook 0.39% Prolog 0.24%

writegpt's Introduction

WriteGPT

image image image image image image

通用型议论文创作人工智能框架,仅限交流与科普。

项目简介

WriteGPT是基于OCR、NLP领域的最新模型所构建的生成式文本创作AI框架,目前第一版finetune模型针对高考作文(主要是议论文),可以有效生成符合人类认知的文章,多数文章经过测试可以达到正常高中生及格作文水平。

项目作者 主页1 主页2
Y1ran CSDN Github

致谢

感谢开源作者@imcaspar 在GPT-2中文预训练框架与数据中的支持。 感谢@白小鱼博士@YJango博士@画渣花小烙@万物拣史@柴知道@风羽酱-sdk@WhatOnEarth@这知识好冷@科技狐 的参与和支持

框架说明

  • 基于EAST、CRNN、Bert和GPT-2语言模型的高考作文生成AI
  • 支持bert tokenizer,当前版本基于clue chinese vocab
  • 17亿参数多模块异构深度神经网络,超2亿条预训练数据
  • 线上点击即用的文本生成效果demo:17亿参数作文杀手
  • 端到端生成,从试卷识别到答题卡输出一条龙服务

Colab线上作文生成功能

国内没有足够显存的免费GPU平台,所以配合Google Drive将训练好的AI核心功能Language Network写作模块迁移到Colab。

当前线上仅开放文本生成功能,输入对应句子,AI返回生成文章。同一个句子可以输入多次,每一次输出都不同。也可以选择同时生成多篇文章。具体见:17亿参数作文杀手

  • 第一步:安装环境

  • 第二部:加载模型

  • 第三步:文章生成

  • 写作效果

本地环境

  • Ubuntu 18.04.2
  • Pandas 0.24.2
  • Regex 2019.4.14
  • h5py 2.9.0
  • Numpy 1.16.2
  • Tensorboard 1.15.2
  • Tensorflow-gpu 1.15.2
  • Requests 2.22.0
  • OpenCV 3.4.2
  • CUDA >= 10.0
  • CuDNN >= 7.6.0

开发日志

  • 2020.06.23 本地Git项目建立
  • 2020.07.03 整体模型架构搭建,开始语料收集
  • 2020.07.13 基于OCR的视觉网络训练
  • 2020.08.01 GPT-2中文预训练模型微调
  • 2020.08.14 Bert文本摘要模型
  • 2020.08.23 通顺度判分网络测试
  • 2020.09.14 排版脚本与输出装置改装
  • 2021.02.15 修复网页版模型打分
  • 2021.06.10 训练集中增加了《***选集》、《陈独秀文集》、《鲁迅文集》等著作

模型结构

整个框架分为EAST、CRNN、Bert、GPT-2、DNN 5个模块,每个模块的网络单独训练,参数相互独立。infer过程使用pipeline串联,通过外接装置直接输出到答题卡。

1. 输入

高考语文试卷作文题

浙江卷

2. 识别网络

2.1 EAST文本检测

OpenCV 的EAST文本检测器是一个深度学习模型,它能够在 720p 的图像上以13帧/秒的速度实时检测任意方向的文本,并可以获得很好的文本检测精度。


模型亮点

  1. 简单的管道实现在当时较高精度的文本检测。
  2. 图像通过FCN处理产生像素级文本缩放地图和几何图形的多个频道。
  3. 可旋转的文本框,可以检测文本也可以检测单词。

EAST文本检测器需要 OpenCV3.4.2 或更高的版本,有需要的读者可以查看 OpenCV 安装教程。虽然EAST的模型在检测自然场景下的英文文本有着较好的性能,要实现中文场景下的中文文本检测,仍然需要重新训练模型。

数据集处理

中文文本识别的数据集要按照原作者的命名方式修改,即使使用ICDAR3013这类标准数据集,也需要修改对应的图片命名方式。原代码数据集的命名方式:图片1.jpg 图片1.txt。

此外,代码是通过获取文件类型然后重新命名以原来的文件类型保存的,所以文本数据和图片数据需要分开处理。

训练命令:

python multigpu_train.py --gpu_list=0 --input_size=512 --batch_size_per_gpu=14 --checkpoint_path=/tmp/east_icdar2015_resnet_v1_50_rbox/ \ --text_scale=512 --training_data_path=/data/ocr/icdar2015/ --geometry=RBOX --learning_rate=0.0001 --num_readers=24 \ --pretrained_model_path=/tmp/resnet_v1_50.ckpt 

更多细节可以参考:https://zhuanlan.zhihu.com/p/64737915


检测结果

除了EAST,也可以把识别网络替换为传统的CTPN等模型,github上有已经成熟的项目:https://github.com/Walleclipse/ChineseAddress_OCR

2.2 CRNN文本识别

参考 https://github.com/ooooverflow/chinese-ocr

数据准备

下载训练集:共约364万张图片,按照99: 1划分成训练集和验证集

数据利用中文语料库(新闻 + 文言文),通过字体、大小、灰度、模糊、透视、拉伸等变化随机生成。包含汉字、英文字母、数字和标点共5990个字符,每个样本固定10个字符,字符随机截取自语料库中的句子,图片分辨率统一为280x32。

修改/train/config.py中train_data_root,validation_data_root以及image_path

训练

cd train  
python train.py

训练结果

Epoch 3/100
25621/25621 [==============================] - 15856s 619ms/step - loss: 0.1035 - acc: 0.9816 - val_loss: 0.1060 - val_acc: 0.9823
Epoch 4/100
25621/25621 [==============================] - 15651s 611ms/step - loss: 0.0798 - acc: 0.9879 - val_loss: 0.0848 - val_acc: 0.9878
Epoch 5/100
25621/25621 [==============================] - 16510s 644ms/step - loss: 0.0732 - acc: 0.9889 - val_loss: 0.0815 - val_acc: 0.9881
Epoch 6/100
25621/25621 [==============================] - 15621s 610ms/step - loss: 0.0691 - acc: 0.9895 - val_loss: 0.0791 - val_acc: 0.9886
Epoch 7/100
25621/25621 [==============================] - 15782s 616ms/step - loss: 0.0666 - acc: 0.9899 - val_loss: 0.0787 - val_acc: 0.9887
Epoch 8/100
25621/25621 [==============================] - 15560s 607ms/step - loss: 0.0645 - acc: 0.9903 - val_loss: 0.0771 - val_acc: 0.9888


2. 语言网络

2.1 BERT文本摘要

BERT的全称是Bidirectional Encoder Representation from Transformers,即双向Transformer的Encoder。模型的主要创新点在pre-train方法上,用了Masked LM和Next Sentence Prediction两种方法分别捕捉词语和句子级别的representation。

模型的构成元素Transformer可以参考Google的 Attention is all you need ,BERT模型的结构如下图最左:

对比OpenAI GPT(Generative pre-trained transformer),BERT是双向的Transformer block连接;就像单向RNN和双向RNN的区别,直觉上来讲效果会好一些。

在原论文中,作者展示了新的语言训练模型,称为编码语言模型与下一句预测

Original Paper : 3.3.1 Task #1: Masked LM

Input Sequence : The man went to [MASK] store with [MASK] dog Target Sequence : the his

规则: 会有15%的随机输入被改变,这些改变基于以下规则

  • 80%的tokens会成为‘掩码’token
  • 10%的tokens会称为‘随机’token
  • 10%的tokens会保持不变但需要被预测

下一句预测

Input : [CLS] the man went to the store [SEP] he bought a gallon of milk [SEP] Label : Is Next Input = [CLS] the man heading to the store [SEP] penguin [MASK] are flight ##less birds [SEP] Label = NotNext

规则:

  • 50%的下一句会(随机)成为连续句子
  • 50%的下一句会(随机)成为不关联句子

训练

python run.py --model bert

测试时,需要用正则表达式过滤考试专用词,包括“阅读下面的材料,根据要求写作”,“要求:xxx”,“请完成/请结合/请综合xx”。

比如

人们用眼睛看他人、看世界,却无法直接看到完整的自己。所以,在人生的旅程中,我们需要寻找各种“镜子”、不断绘制“自画像”来审视自我,尝试回答“我是怎样的人”“我想过怎样的生活”“我能做些什么”“如何生活得更有意义”等重要的问题。

2.2 GPT-2文本生成

参考:https://github.com/imcaspar/gpt2-ml/

预训练语料来自 THUCNews 以及 nlp_chinese_corpus,清洗后总文本量约 15G。 Finetune语料来自历年满分高考作文、优质散文集以及近现代散文作品,约1000篇。

预训练
参考 GPT2-ML 预训练模型,使用 Quadro RTX 8000 训练 28w 步


Finetune

1、进入dataset目录
python pre_data.py --filepath /data/home/share1/gpt2-ml-Finetune/data-mayun_xiugai --outfile /data/home/share1/gpt2-ml-Finetune/data/22.json
filepath为finetune数据目录

2、生成tfrecord训练数据
python prepare_data.py -input_fn /data/home/share1/gpt2-ml-Finetune/data

3、finetune
CUDA_VISIBLE_DEVICES=0  python train/train_wc.py --input_file=/data/EssayKiller/gpt2-ml-Finetune/data/train.tfrecord --output_dir=/data/EssayKiller/gpt2-ml-Finetune/finetune_model --init_checkpoint=/data/EssayKiller/gpt2-ml/models/mega/model.ckpt-220000

3.判分网络

3.1 DNN判分模型

这部分直接调用百度API。有现成的模型就不重复造轮子了,具体实现方式百度没有开源,这里简单描述一下语言模型的概念: 语言模型是通过计算给定词组成的句子的概率,从而判断所组成的句子是否符合客观语言表达习惯。通常用于机器翻译、拼写纠错、语音识别、问答系统、词性标注、句法分析和信息检索等。

这里使用通顺度打分作为判断依据。

3.2 高考排版器

标题
复用BERT_SUM生成Top3的NER粒度token作为标题

主体
高考议论文的写作格式要求如下:

  1. 标题居中,一般少于20字
  2. 每段段首缩进两格
  3. 每个字符尽量保持在字体框内
  4. 字数不能过长或过短

由于模型输出的文章不保证换行和分段,通过统计高考作文的常见段数、每段句数,编写脚本对输出进行划分。大多数情况下分段排版的结果都比较合理。


输出

答题卡

外接装置

基于aedraw,一款开源的CNC(Computer Numerical Control数控机床)画图机器人,具有绘制图案、写字等功能,它也可以升级为激光雕刻等用途。 详细教程见 http://aelab.net/ ,不仅能自己制作一台写字绘画机器人,而且能够掌握其工作原理拓展更多的应用。

原版的输出临摹装置存在速度慢和格式不准的问题,通过改装和修改源代码得以优化

  • 因为时间原因目前的手写装置还有些问题,偶尔会有漏写、越格的问题
  • 视频中的作文经过后期的人工处理,补上了漏字

预训练模型

模型 参数量 下载链接 备注
EAST < 0.1 Billion GoogleDrive 检测模型
CRNN < 0.1 Billion 网盘链接 提取码:vKeD 识别模型
BERT 0.1 Billion GoogleDrive 摘要模型
GPT-2 1.5 Billion GoogleDrive 生成模型

整个AI的参数量分布不均匀,主要原因在于,这是一个语言类AI,99%的参数量集中在语言网络中,其中GPT-2(15亿)占88%,BERT(1.1亿)占7%,其他的识别网络和判分网络共占5%。

当前问题

  • 输出的格式和高考作文还不能完美契合,之后的参数需要微调一下。为了国庆前完成,我还没来得及优化
  • 生成的100篇作文里有很大一部分其实算不上合格的作文,有些只能勉强及格,有些甚至能拿零分(占比不多),显然GPT-2的能力有限。为了视频效果我只选了相对好的几篇做展示
  • 英文版的说明还没来得及写,有空的同学可以翻译一下提个pr

Q&A

  • 我能否用EssayKiller来帮自己写作业?
    不能。所以有下一个问题:

  • 为什么缺少一些关键文件?
    项目在一开始是完全开源的,经过慎重考虑我认为完全开源会被部分别有用心的人用以牟利,甚至用作不法用途。参考咸鱼和淘宝上一些魔改的开源框架应用。部分懂技术又不想动笔的小同志可能会让Essaykiller帮自己写作业,比如读后感、课后作文、思修小论文。我想说,这样不好。

  • 为什么不直接加密?
    本来打算用混淆加密,但一些模块本就是开源的,所以我开源了整体的模型文件,只隐藏了关键的,包括pipeline、输入输出在内的文件,另外有些文件里也加了盐。

  • 有哪些模组可用?
    目前完全开源,可以独立复用的部分包括:

    • 检测网络
    • 文本摘要网络
    • 文本生成网络
    • 判分网络与排版脚本
  • 为什么不用GPT-3
    训练一个中文GPT-3的价格至少为1200万美元,折合人民币将近1亿。要是真有人训练出来一个中文GPT-3还开源模型文件了,我愿称之为最强。

  • 训练EssayKiller需要多少钱?
    从头到尾训练完pipeline的话在1K~100K人民币不等,取决于你有无分布式集群可用


Citation

@misc{EssayKillerBrain,
  author = {Turing's Cat},
  title = {Autowritting Ai Framework},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/EssayKillerBrain/writeGPT}},
}

参考资料

[1] BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
[2] ERNIE: Enhanced Representation through Knowledge Integration
[3] Fine-tune BERT for Extractive Summarization
[4] EAST: An Efficient and Accurate Scene Text Detector
[5] An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
[6] Language Models are Unsupervised Multitask Learners
[7] https://github.com/Morizeyao/GPT2-Chinese
[8] https://github.com/argman/EAST
[9] https://github.com/bgshih/crnn
[10] https://github.com/zhiyou720/chinese_summarizer
[11] https://zhuanlan.zhihu.com/p/64737915
[12] https://github.com/ouyanghuiyu/chineseocr_lite
[13] https://github.com/google-research/bert
[14] https://github.com/rowanz/grover
[15] https://github.com/wind91725/gpt2-ml-finetune-
[16] https://github.com/guodongxiaren/README
[17] https://www.jianshu.com/p/55560d3e0e8a
[18] https://github.com/YCG09/chinese_ocr
[19] https://github.com/xiaomaxiao/keras_ocr
[20] https://github.com/nghuyong/ERNIE-Pytorch
[21] https://zhuanlan.zhihu.com/p/43534801 [22] https://blog.csdn.net/xuxunjie147/article/details/87178774/
[23] https://github.com/JiangYanting/Pre-modern_Chinese_corpus_dataset
[24] https://github.com/brightmart/nlp_chinese_corpus
[25] https://github.com/SophonPlus/ChineseNlpCorpus
[26] https://github.com/THUNLP-AIPoet/Resources
[27] https://github.com/OYE93/Chinese-NLP-Corpus
[28] https://github.com/CLUEbenchmark/CLUECorpus2020
[29] https://github.com/zhiyou720/chinese_summarizer

免责声明

该项目中的内容仅供技术研究与科普,不作为任何结论性依据,不提供任何商业化应用授权

writegpt's People

Contributors

trellixvulnteam avatar trustyboy avatar y1ran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

writegpt's Issues

mac不能跑吗,部署没问题了,不出结果

20多分钟了,一直不出结果
(aitext) laogege@localhost GPT2 % python scripts/demo.py -ckpt_fn finetune/trained_models/model.ckpt-280000 -min_len 1024 -samples 1
WARNING:tensorflow:From /Users/laogege/pythonwork3/aitext/EssayKiller_V2-master/LanguageNetwork/GPT2/scripts/modeling.py:141: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.Dense instead.
WARNING:tensorflow:From /Users/laogege/.pyenv/versions/aitext/lib/python3.6/site-packages/tensorflow_core/python/layers/core.py:187: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use layer.__call__ method instead.
WARNING:tensorflow:From /Users/laogege/.pyenv/versions/aitext/lib/python3.6/site-packages/tensorflow_core/python/util/dispatch.py:180: batch_gather (from tensorflow.python.ops.array_ops) is deprecated and will be removed after 2017-10-25.
Instructions for updating:
tf.batch_gather is deprecated, please use tf.gather with batch_dims=-1 instead.
模型加载好啦!🍺Bilibili干杯🍺

现在将你的作文题精简为一个句子,粘贴到这里:⬇️,然后回车

作文题目

我爱你老师

作文题目

正在生成第 1 of 1 篇文章

......

EssayKiller正在飞速写作中,请稍后......

【解决方法】线上版本报错result.txt找不到

这是由于模型文件没有下载完成的缘故,5个多g的文件,
清空finetune/trained_models下面的文件多运行几次(第二 步操作)试试,
或者直接下载文件到trained_models目录下面,也可试试从挂载google云盘从云盘上面复制过去。
1
2
3

网页版无法正常运行,😭

报错如下:
#!cat /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/tpu/tpu_feed.py
#@title #文章生成模块
作文最小篇幅 = 850 #@param {type:"number", min:800, max:1024, step:1}
生成作文篇数 = 1 #@param {type:"number", min:1, max:100, step:1}
%mv /home/EssayKiller_V2/LanguageNetwork/GPT2/finetune/models/mega/* /home/EssayKiller_V2/LanguageNetwork/GPT2/finetune/trained_models/
%cd /home/EssayKiller_V2/LanguageNetwork/GPT2/
!export TF_CPP_MIN_LOG_LEVEL=2
!echo '模型加载中,请稍后......'
!PYTHONPATH=$(pwd) python scripts/demo.py -ckpt_fn finetune/trained_models/model.ckpt-280000 -min_len $作文最小篇幅 -samples $生成作文篇数
!PYTHONPATH=$(pwd) python scripts/formatter.py -org_text result.txt

Colab中模型文件model.ckpt-280000.data-00000-of-00001下载失败

输出信息:

/home
fatal: destination path 'EssayKiller' already exists and is not an empty directory.
/home/EssayKiller/AutoWritter/finetune
trained_models/mode     [ <=>                ]   3.02K  --.-KB/s    in 0s      
Couldn't download the file :-(
model.ckpt-280000.i 100%[===================>]  70.68K   432KB/s    in 0.2s    
model.ckpt-280000.m 100%[===================>]  12.49M  15.0MB/s    in 0.8s    
模型下载完成,Git项目已构建,请继续点击下方的▶️

经倒数第二行注释的提示取消最后一行的注释。
但是下载的文件也是错误的,模型无法运行。
自己捣鼓了下,正确的应该是这样的:!python3 /home/EssayKiller/AutoWritter/scripts/down_gdrive_file.py -file_id='1ujWYTOvRLGJX0raH-f-lPZa3-RN58ZQx' -file_path='models/mega/model.ckpt-280000.data-00000-of-00001'
运行模型也没有再出现错误。

有没有大佬知道怎么改

mv: cannot stat '/home/EssayKiller_V2/LanguageNetwork/GPT2/finetune/models/mega/*': No such file or directory
/home/EssayKiller_V2/LanguageNetwork/GPT2
模型加载中,请稍后......
python3: can't open file 'sc': [Errno 2] No such file or directory
the lens: 13
Traceback (most recent call last):
File "scripts/formatter.py", line 132, in
with open(args.org_text, 'r',encoding='UTF-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'result.txt'

cpu跑通了,但是时间很久,gpu还是没成功

用cpu跑通demo了,但是用gpu跑不了,求救!!!

1.机器配置

操作系统:Windows 10
硬件配置环境

显卡:3070ti 8g
处理器:i9 7980xe
cuda 10.0
cudnn 7.6.5
内存 64g

软件依赖

pandas==0.24.2
regex==2019.4.14
h5py==2.9.0
numpy==1.16.2
tensorboard==1.13.1
tensorflow-gpu==1.13.1
tqdm==4.31.1
requests==2.22.0
protobuf==3.19.0

2.报错、解决思路、替代方案

模型加载好啦!🍺Bilibili干杯🍺 

现在将你的作文题精简为一个句子,粘贴到这里:⬇️,然后回车


**********************************************作文题目**********************************************

苦练本手,方能妙手随成


**********************************************作文题目**********************************************

正在生成第  1  of  1 篇文章

......

EssayKiller正在飞速写作中,请稍后......

2022-11-27 19:19:37.206277: E tensorflow/stream_executor/cuda/cuda_blas.cc:428] failed to run cuBLAS routine: CUBLAS_STATUS_EXECUTION_FAILED
2022-11-27 19:19:37.206746: E tensorflow/stream_executor/cuda/cuda_blas.cc:2301] Internal: failed BLAS call, see log for details
Traceback (most recent call last):
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call
    return fn(*args)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\client\session.py", line 1350, in _run_fn
    target_list, run_metadata)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\client\session.py", line 1443, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.InternalError: 2 root error(s) found.
  (0) Internal: Blas xGEMMBatched launch failed : a.shape=[24,11,64], b.shape=[24,11,64], m=11, n=11, k=64, batch_size=24
         [[{{node sample_sequence/newslm/layer00/MatMul}}]]
         [[sample_sequence/while/Identity/_1594]]
  (1) Internal: Blas xGEMMBatched launch failed : a.shape=[24,11,64], b.shape=[24,11,64], m=11, n=11, k=64, batch_size=24
         [[{{node sample_sequence/newslm/layer00/MatMul}}]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:/ly/EssayKiller_V2-master/LanguageNetwork/GPT2/scripts/demo.py", line 220, in <module>
    p_for_topp: top_p[chunk_i]})
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run
    run_metadata_ptr)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run
    feed_dict_tensor, options, run_metadata)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run
    run_metadata)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\client\session.py", line 1384, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InternalError: 2 root error(s) found.
  (0) Internal: Blas xGEMMBatched launch failed : a.shape=[24,11,64], b.shape=[24,11,64], m=11, n=11, k=64, batch_size=24
         [[node sample_sequence/newslm/layer00/MatMul (defined at C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]]
         [[sample_sequence/while/Identity/_1594]]
  (1) Internal: Blas xGEMMBatched launch failed : a.shape=[24,11,64], b.shape=[24,11,64], m=11, n=11, k=64, batch_size=24
         [[node sample_sequence/newslm/layer00/MatMul (defined at C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'sample_sequence/newslm/layer00/MatMul':
  File "d:/ly/EssayKiller_V2-master/LanguageNetwork/GPT2/scripts/demo.py", line 188, in <module>
    do_topk=False)
  File "d:\ly\EssayKiller_V2-master\LanguageNetwork\GPT2\scripts\modeling.py", line 768, in sample
    do_topk=do_topk)
  File "d:\ly\EssayKiller_V2-master\LanguageNetwork\GPT2\scripts\modeling.py", line 740, in initialize_from_context
    batch_size=batch_size, p_for_topp=p_for_topp, cache=None, do_topk=do_topk)
  File "d:\ly\EssayKiller_V2-master\LanguageNetwork\GPT2\scripts\modeling.py", line 714, in sample_step
    cache=cache,
  File "d:\ly\EssayKiller_V2-master\LanguageNetwork\GPT2\scripts\modeling.py", line 499, in __init__
    cache=layer_cache,
  File "d:\ly\EssayKiller_V2-master\LanguageNetwork\GPT2\scripts\modeling.py", line 198, in attention_layer
    attention_scores = tf.matmul(query, key, transpose_b=True)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\util\dispatch.py", line 180, in wrapper
    return target(*args, **kwargs)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\ops\math_ops.py", line 2716, in matmul
    return batch_mat_mul_fn(a, b, adj_x=adjoint_a, adj_y=adjoint_b, name=name)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\ops\gen_math_ops.py", line 1712, in batch_mat_mul_v2
    "BatchMatMulV2", x=x, y=y, adj_x=adj_x, adj_y=adj_y, name=name)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\framework\op_def_library.py", line 794, in _apply_op_helper
    op_def=op_def)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3357, in create_op
    attrs, op_def, compute_device)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3426, in _create_op_internal
    op_def=op_def)
  File "C:\Users\ly1995\AppData\Local\conda\conda\envs\zuowen1\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1748, in __init__
    self._traceback = tf_stack.extract_stack()

2.1 关键信息抽取

(0) Internal: Blas xGEMMBatched launch failed : a.shape=[24,11,64], b.shape=[24,11,64], m=11, n=11, k=64, batch_size=24

2.2 问题分析

通过bing搜索报错信息,得知了报错原因,主要是因为显存不够造成的

2.3 想法1

既然显存不够,那就减少一些显存,让程序灵活调用显存,这样问题就解决了吧,于是我加入了如下语句

os.environ["CUDA_VISIBLE_DEVICES"] = "0"
tf_config = tf.compat.v1.ConfigProto(allow_soft_placement=True)
tf_config.gpu_options.allow_growth=True
# tf_config.gpu_options.per_process_gpu_memory_fraction = 0.6

...可还是报错,是因为显存不够吗...

替代方案1

既然gpu跑不了,那干脆不用gpu了,用cpu试试,于是我修改了以下语句

os.environ["CUDA_VISIBLE_DEVICES"] = " " #将0改为none

结果:程序跑通了,但是cpu跑肯定比gpu慢很多,跑一篇作文大概要10min,cpu占用率大概为40-50

模型参数设置出错了

mv: cannot stat '/home/EssayKiller_V2/LanguageNetwork/GPT2/finetune/models/mega/*': No such file or directory

最后显示的是FileNotFoundError: [Errno 2] No such file or directory: 'result.txt'

或许可以改进一下

在线版根据#9 已经成功运行
不过生成的文章里有个神奇的东西
“优秀范文字篇六”
image

最后一步报错

/home/EssayKiller/AutoWritter 模型加载中,你可以去看会儿B站...... WARNING:tensorflow:From /home/EssayKiller/AutoWritter/scripts/modeling.py:141: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version. Instructions for updating: Use keras.layers.Dense instead. WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/layers/core.py:187: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version. Instructions for updating: Please use layer.callmethod instead. WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/dispatch.py:180: batch_gather (from tensorflow.python.ops.array_ops) is deprecated and will be removed after 2017-10-25. Instructions for updating:tf.batch_gatheris deprecated, please usetf.gatherwithbatch_dims=-1` instead.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
return fn(*args)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
target_list, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: Read less bytes than requested
[[{{node save/RestoreV2}}]]
[[save/RestoreV2/_301]]
(1) Out of range: Read less bytes than requested
[[{{node save/RestoreV2}}]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "scripts/demo.py", line 179, in
saver.restore(sess, args.ckpt_fn)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 1290, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 956, in run
run_metadata_ptr)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: Read less bytes than requested
[[node save/RestoreV2 (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
[[save/RestoreV2/_301]]
(1) Out of range: Read less bytes than requested
[[node save/RestoreV2 (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'save/RestoreV2':
File "scripts/demo.py", line 178, in
saver = tf.compat.v1.train.Saver()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 828, in init
self.build()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 840, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 878, in _build
build_restore=build_restore)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 508, in _build_internal
restore_sequentially, reshape)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 328, in _AddRestoreOps
restore_sequentially)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 575, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/gen_io_ops.py", line 1696, in restore_v2
name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
attrs, op_def, compute_device)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
op_def=op_def)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 1748, in init
self._traceback = tf_stack.extract_stack()

the lens: 13
scoring api has failed...
0`

缺少文件

tensorflow.python.framework.errors_impl.NotFoundError: 2 root error(s) found.
(0) Not found: finetune/trained_models/model.ckpt-344000.data-00000-of-00001; No such file or directory
[[{{node save/RestoreV2}}]]
(1) Not found: finetune/trained_models/model.ckpt-344000.data-00000-of-00001; No such file or directory
[[{{node save/RestoreV2}}]]
[[save/RestoreV2/_301]]

线上网站最后一步出错

mv: cannot stat '/home/EssayKiller_V2/LanguageNetwork/GPT2/finetune/models/mega/*': No such file or directory
/home/EssayKiller_V2/LanguageNetwork/GPT2
模型加载中,请稍后......
WARNING:tensorflow:From /home/EssayKiller_V2/LanguageNetwork/GPT2/scripts/modeling.py:141: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.Dense instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/layers/core.py:187: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use layer.__call__ method instead.
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/dispatch.py:180: batch_gather (from tensorflow.python.ops.array_ops) is deprecated and will be removed after 2017-10-25.
Instructions for updating:
tf.batch_gather is deprecated, please use tf.gather with batch_dims=-1 instead.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
return fn(*args)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
target_list, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: Read less bytes than requested
[[{{node save/RestoreV2}}]]
[[save/RestoreV2/_301]]
(1) Out of range: Read less bytes than requested
[[{{node save/RestoreV2}}]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "scripts/demo.py", line 179, in
saver.restore(sess, args.ckpt_fn)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 1290, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 956, in run
run_metadata_ptr)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: Read less bytes than requested
[[node save/RestoreV2 (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
[[save/RestoreV2/_301]]
(1) Out of range: Read less bytes than requested
[[node save/RestoreV2 (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'save/RestoreV2':
File "scripts/demo.py", line 178, in
saver = tf.compat.v1.train.Saver()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 828, in init
self.build()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 840, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 878, in _build
build_restore=build_restore)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 508, in _build_internal
restore_sequentially, reshape)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 328, in _AddRestoreOps
restore_sequentially)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 575, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/gen_io_ops.py", line 1696, in restore_v2
name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
attrs, op_def, compute_device)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
op_def=op_def)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 1748, in init
self._traceback = tf_stack.extract_stack()

the lens: 13
Traceback (most recent call last):
File "scripts/formatter.py", line 132, in
with open(args.org_text, 'r',encoding='UTF-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'result.txt'

数据集

您好,请问使用的鲁迅数据集可以分享一下吗?

Colab 模型参数设置 运行报错,所有的参数都没有改过

mv: cannot stat '/home/EssayKiller_V2/LanguageNetwork/GPT2/finetune/models/mega/*': No such file or directory
/home/EssayKiller_V2/LanguageNetwork/GPT2
模型加载中,请稍后......
WARNING:tensorflow:From /home/EssayKiller_V2/LanguageNetwork/GPT2/scripts/modeling.py:141: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.Dense instead.
WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/layers/core.py:187: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use layer.__call__ method instead.
WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/util/dispatch.py:180: batch_gather (from tensorflow.python.ops.array_ops) is deprecated and will be removed after 2017-10-25.
Instructions for updating:
tf.batch_gather is deprecated, please use tf.gather with batch_dims=-1 instead.
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
return fn(*args)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
target_list, run_metadata)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: Read less bytes than requested
[[{{node save/RestoreV2}}]]
[[save/RestoreV2/_301]]
(1) Out of range: Read less bytes than requested
[[{{node save/RestoreV2}}]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "scripts/demo.py", line 179, in
saver.restore(sess, args.ckpt_fn)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 1290, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 956, in run
run_metadata_ptr)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
run_metadata)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: Read less bytes than requested
[[node save/RestoreV2 (defined at /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
[[save/RestoreV2/_301]]
(1) Out of range: Read less bytes than requested
[[node save/RestoreV2 (defined at /usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'save/RestoreV2':
File "scripts/demo.py", line 178, in
saver = tf.compat.v1.train.Saver()
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 828, in init
self.build()
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 840, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 878, in _build
build_restore=build_restore)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 508, in _build_internal
restore_sequentially, reshape)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 328, in _AddRestoreOps
restore_sequentially)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/training/saver.py", line 575, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/ops/gen_io_ops.py", line 1696, in restore_v2
name=name)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
attrs, op_def, compute_device)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
op_def=op_def)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 1748, in init
self._traceback = tf_stack.extract_stack()

the lens: 13
Traceback (most recent call last):
File "scripts/formatter.py", line 132, in
with open(args.org_text, 'r',encoding='UTF-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'result.txt'

这几行无数次出现,等了20多分钟还没加载好模型,是什么问题呀?

--2022-03-30 15:38:00-- https://docs.google.com/uc?id=1A910UqSNBBi_SEoIDl15095T_5kojESO&export=download
Resolving docs.google.com (docs.google.com)... 64.233.184.138, 64.233.184.101, 64.233.184.139, ...
Connecting to docs.google.com (docs.google.com)|64.233.184.138|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘trained_models/model.ckpt-280000.data-00000-of-00001’

 0K                                     22.8M=0s

2022-03-30 15:38:01 (22.8 MB/s) - ‘trained_models/model.ckpt-280000.data-00000-of-00001’ saved [2226]

模型框架加载模块时卡在gdown.pl

如题,程序会卡在下载 trained_models/model.ckpt-280000.data-00000-of-00001 ,然后重复输出:

--2022-06-02 12:30:58--  https://docs.google.com/uc?id=1A910UqSNBBi_SEoIDl15095T_5kojESO&export=download
Resolving docs.google.com (docs.google.com)... 173.194.218.101, 173.194.218.138, 173.194.218.102, ...
Connecting to docs.google.com (docs.google.com)|173.194.218.101|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘trained_models/model.ckpt-280000.data-00000-of-00001’

     0K                                     40.1M=0s

2022-06-02 12:30:58 (40.1 MB/s) - ‘trained_models/model.ckpt-280000.data-00000-of-00001’ saved [2241]

我被卡在这里已经半个多小时了,还是一直这样。如果强制停止,再继续执行第三步就会Error。

请问应该如何解决这个问题?

colab网页版卡在第二部分中perl指令处,持续下载

网页版挂着十几个小时直到连接自动断开也没有下载完毕,期间这几行重复出现,只是resolving和connecting两行的ip地址,和下载速度在改变;右上角ram占用极低

`
--2022-06-07 12:12:38-- https://docs.google.com/uc?id=1A910UqSNBBi_SEoIDl15095T_5kojESO&export=download
Resolving docs.google.com (docs.google.com)... 74.125.31.113, 74.125.31.102, 74.125.31.101, ...
Connecting to docs.google.com (docs.google.com)|74.125.31.113|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘trained_models/model.ckpt-280000.data-00000-of-00001’

 0K                                     13.5M=0s

2022-06-07 12:12:38 (13.5 MB/s) - ‘trained_models/model.ckpt-280000.data-00000-of-00001’ saved [2241]
`

`
--2022-06-07 12:12:38-- https://docs.google.com/uc?id=1A910UqSNBBi_SEoIDl15095T_5kojESO&export=download
Resolving docs.google.com (docs.google.com)... 173.194.218.138, 173.194.218.139, 173.194.218.113, ...
Connecting to docs.google.com (docs.google.com)|173.194.218.138|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘trained_models/model.ckpt-280000.data-00000-of-00001’

 0K                                     29.5M=0s

2022-06-07 12:12:38 (29.5 MB/s) - ‘trained_models/model.ckpt-280000.data-00000-of-00001’ saved [2241]
`

finetune数据集

您好,请问fine-tune数据集,散文、优质作文的这部分可以分享一下吗?

需要运行多久

运行需要多久才能出文章呢我运行了十几分钟都没反应····
图片

GPT-2文件无效

EAST | 有效
CRNN | 有效
BERT |有效
GPT-2 | 失效,提示错误页面

烦请更新一下共享链接,因为看了B站的视频,对机器学习产生了兴趣
在此保证严格遵守约定不作任何商业或非法用途,不用来牟利,仅作学习之用。

线上colab版本最后一步错误

看了下貌似都有个问题按照其他提供的办法还是这样报错是刻意删除了部分代码防止商用还是操作有问题啊

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.