2019-01-12T08:57:11.365347968Z Traceback (most recent call last):
2019-01-12T08:57:11.365356288Z File "train.py", line 464, in
2019-01-12T08:57:11.372669118Z main(True, False)
2019-01-12T08:57:11.372698132Z File "train.py", line 454, in main
2019-01-12T08:57:11.378781933Z un_zip("./datasets/data1919/Road02.zip")
2019-01-12T08:57:11.378804253Z File "train.py", line 57, in un_zip
2019-01-12T08:57:11.382992884Z zip_file.extractall(file_name + "_files/")
2019-01-12T08:57:11.383037571Z File "/usr/lib/python2.7/zipfile.py", line 1040, in extractall
2019-01-12T08:57:11.383377887Z self.extract(zipinfo, path, pwd)
2019-01-12T08:57:11.383388664Z File "/usr/lib/python2.7/zipfile.py", line 1028, in extract
2019-01-12T08:57:11.383587234Z return self._extract_member(member, path, pwd)
2019-01-12T08:57:11.383614669Z File "/usr/lib/python2.7/zipfile.py", line 1084, in _extract_member
2019-01-12T08:57:11.383862346Z shutil.copyfileobj(source, target)
2019-01-12T08:57:11.383870591Z IOError: [Errno 5] Input/output error
log报io错误
解压缩程序如下:
def un_zip(file_name):
zip_file = zipfile.ZipFile(file_name)
if os.path.isdir(file_name + "_files"):
pass
else:
os.mkdir(file_name + "_files")
for names in zip_file.namelist():
zip_file.extract(names, file_name + "_files/")
zip_file.close()
你这是在集群上运行的代码吗
是的,在集群上
不是很清楚,我看群里有说好像是不能覆盖写和随机写,你可以在解压前每次删除原来的文件,然后再解压试试呢
请问这个问题解决了吗?遇到了一模一样的问题