我使用 pickle 保存了一个经过训练的 ANN 模型(作为 .sav 文件)。我使用以下脚本打开文件:
filename ='TuneMoveTrain24.sav'
trained_model = pickle.load(open(filename,'rb'))
代码运行良好,但突然出现以下错误:
BadZipFile Traceback (most recent call last)
<ipython-input-4-5aa76a0b85f5> in <module>
1 filename ='TuneMoveTrain24.sav'
----> 2 trained_model = pickle.load(open(filename,'rb'))
5 frames
/usr/lib/python3.8/zipfile.py in _RealGetContents(self)
1334 raise BadZipFile("File is not a zip file")
1335 if not endrec:
-> 1336 raise BadZipFile("File is not a zip file")
1337 if self.debug > 1:
1338 print(endrec)
BadZipFile: File is not a zip file
知道发生了什么事吗?谢谢。
我尝试使用不同的 PC 但没有解决方案。