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

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 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么