m0_57965808 2022-01-08 09:37 采纳率: 91.2%
浏览 168
已结题

GPT2--Chinese生成文本报错

问题遇到的现象和发生背景

从GITHUB下载了一个可以生成中文文本的项目:https://github.com/Morizeyao/GPT2-Chinese来学习,前几天一直在研究代码,今天想试试生成文本来着,但是报错了。

我在终端输入的代码与报错:
1 python ./generate.py --length=400 --nsamples=4 --prefix=在遥远的未来 --fast_pattern --save_samples --save_samples_path=/mnt/samples.txt
python: can't open file './generate.py': [Errno 2] No such file or directory
2 python .F:/GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22/generate.py --length=400 --nsamples=4 --prefix=在遥远的未来 --fast_pattern --save_samples --save_samples_path=/mnt/samples.txt
python: can't open file '.F:/GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22/generate.py': [Errno 22] Invalid argument
3 python .F:/GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22/generate.py --length=400 --nsamples=4 --prefix=在遥远的未来 --fast_pattern --save_samples --save_samples_path=/mnt/samples.txt
python: can't open file '.F:/GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22/generate.py': [Errno 22] Invalid argument
4 python .r'F:/GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22/generate.py' --length=400 --nsamples=4 --prefix=在遥远的未来 --fast_pattern --save_samples --save_samples_path=/mnt/samples.txt
python: can't open file '.r'F:/GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22/generate.py'': [Errno 22] Invalid argument
5 python .F//GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22/generate.py --length=400 --nsamples=4 --prefix=在遥远的未来 --fast_pattern --save_samples --save_samples_path=/mnt/samples.txt
python: can't open file '.F//GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22/generate.py': [Errno 2] No such file or directory
望各位有识之士不吝赐教

  • 写回答

1条回答 默认 最新

  • 陈年椰子 2022-01-08 15:41
    关注

    你下的项目, 保存到什么位置。
    要先确认 generate.py 所在目录。
    看你的运行命令,貌似在这个地方 F:/GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22
    进入windows的控制台
    依次输入以下命令试试

    f:
    cd F:/GTP/GPT-Chinese/GPT2-Chinese-old_gpt_2_chinese_before_2021_4_22
    python generate.py --length=400 --nsamples=4 --prefix=在遥远的未来 --fast_pattern --save_samples --save_samples_path=F:/GTP/samples.txt
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 1月16日
  • 已采纳回答 1月8日
  • 创建了问题 1月8日

悬赏问题

  • ¥30 Matlab打开默认名称带有/的光谱数据
  • ¥50 easyExcel模板 动态单元格合并列
  • ¥15 res.rows如何取值使用
  • ¥15 在odoo17开发环境中,怎么实现库存管理系统,或独立模块设计与AGV小车对接?开发方面应如何设计和开发?请详细解释MES或WMS在与AGV小车对接时需完成的设计和开发
  • ¥15 CSP算法实现EEG特征提取,哪一步错了?
  • ¥15 游戏盾如何溯源服务器真实ip?需要30个字。后面的字是凑数的
  • ¥15 vue3前端取消收藏的不会引用collectId
  • ¥15 delphi7 HMAC_SHA256方式加密
  • ¥15 关于#qt#的问题:我想实现qcustomplot完成坐标轴
  • ¥15 下列c语言代码为何输出了多余的空格