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

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日

    悬赏问题

    • ¥15 eclipse无法正常运行
    • ¥15 定义了函数,但是无法根据函数定义触发器
    • ¥20 5变量卡诺图化简得出与非门电路图
    • ¥20 位置依赖的碱基序列独热编码
    • ¥15 Python爬取交通拥堵指数数据
    • ¥15 使用vba抓取重定向网页问题
    • ¥20 付费需求测试程序(细谈)。
    • ¥15 为什么这段c++代码会报这么多语法错误?
    • ¥20 如何利用C语言实现用最小二乘法选配两个经验公式
    • ¥50 vue-codemirror如何对指定行 指定位置的 字符进行背景颜色或者字体颜色的修改?