Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.py: error&&KeyError: "There is no item named 'imgHQ06409.png' in the archive" #22

Open
lantingyue11 opened this issue Oct 8, 2020 · 4 comments

Comments

@lantingyue11
Copy link

test.py: error: the following arguments are required: -l/--level
can you tell me the question?
And how deal with dataset in datazip?

@lantingyue11 lantingyue11 changed the title hello test.py: error&&KeyError: "There is no item named 'imgHQ06409.png' in the archive" Oct 8, 2020
@sdulyq
Copy link

sdulyq commented Apr 16, 2021

That is because the zip file is not correct. You have to use python to rezip what you need.


import zipfile  # 导入模块
# BASE_STATIC_CASE_RESULT:我Django static下面的某个路径
base_dir = os.path.join('G:/obm_project', 'trainA')  # 要压缩文件夹的根路径
zip_file_name = 'trainA.zip'
f = zipfile.ZipFile(os.path.join('G:/obm_project', zip_file_name), 'w', zipfile.ZIP_DEFLATED)
for dir_path, dir_name, file_names in os.walk(base_dir):
    # 要是不replace,就从根目录开始复制
    file_path = dir_path.replace(base_dir, '')
    # 实现当前文件夹以及包含的所有文件
    file_path = file_path and file_path + os.sep or ''
    for file_name in file_names:
        f.write(os.path.join(dir_path, file_name), file_path + file_name)
f.close()

@lantingyue11
Copy link
Author

lantingyue11 commented Apr 16, 2021 via email

@sdulyq
Copy link

sdulyq commented Apr 16, 2021

你解决问题了吗请问。我还是不知道怎么训练自己的数据集

@TuTuhhhh
Copy link

TuTuhhhh commented Dec 9, 2022

test.py: error: the following arguments are required: -l/--level

请问这个问题您解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants