关于#python#的问题:文件加载出现 EOFError: Ran out of input

EOFError: Ran out of input
问题相关代码,请勿粘贴截图

img

img

运行结果及报错内容

img

我的解答思路和尝试过的方法

以前是报错:

Traceback (most recent call last):
  File "tools/main.py", line 56, in <module>
    main(args, cfg)
  File "tools/main.py", line 39, in main
    trainer.load(args.load)
  File "D:\代码\PaddleGAN\ppgan\engine\trainer.py", line 430, in load
    state_dicts = load(weight_path)
  File "D:\代码\PaddleGAN\ppgan\utils\filesystem.py", line 71, in load
    state_dicts = pickle.load(f, encoding='latin1') if six.PY2 else pickle.load(f, encoding='latin1')
_pickle.UnpicklingError: could not find MARK

网上找的方法是加一个f.seek(0)

我想要达到的结果