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

win11 py3.11.5 cu118 torch2.2.2 pyqt5崩溃,导致window11系统自动重启问题。 #157

Open
Joneedhome opened this issue Apr 18, 2024 · 2 comments

Comments

@Joneedhome
Copy link

Windows日志:
错误应用程序名称: python.exe,版本: 3.11.5150.1013,时间戳: 0x64ff15d0
错误模块名称: Qt5Core_conda.dll,版本: 5.15.2.0,时间戳: 0x64a8c833
异常代码: 0xc0000409
错误偏移量: 0x00000000000205a8
错误进程 ID: 0x0x257C
错误应用程序启动时间: 0x0x1DA9046D3352554
错误应用程序路径: C:\Users\xx.conda\envs\sam_env\python.exe
错误模块路径: C:\Users\xx.conda\envs\sam_env\Library\bin\Qt5Core_conda.dll
报告 ID: xxxxxxxxxxx
错误程序包全名:
错误程序包相对应用程序 ID:

使用sam进行辅助标注的时候,一般在标注过程中出现,已经标注了一部分推按,随机不知多久会崩溃,一般不开启SAM不会崩溃。

错误码:异常代码0xc0000409通常表示“堆栈缓冲区溢出”。

这可能是由于软件中存在未检查或未正确处理的数组越界访问,这种错误可以导致程序崩溃,并可能危及系统的稳定性。

具体数组越界是在哪里,目前我没有进行去深究,作者对代码比较熟悉,方便的话可以查查问题。

@Joneedhome
Copy link
Author

Joneedhome commented Apr 22, 2024

经过多次崩溃,一般发生在鼠标操作,或者sam生成坐标点的位置,具体崩溃的位置,后面我试着再查查,还有一个问题,就是因为程序崩溃,导致标注的json文件损坏,会导致制作的数据集,比如转coco的时候失败,原因就在于损坏的json,我的解决办法是在尝试读取json文件前,加入了一个json解析的尝试。

代码如下:

       try:  
            # 尝试打开并解析JSON文件  
            with open(json_file, 'r', encoding='utf-8') as f:  
                load(f)  
            print(f"JSON文件 {json_file} 验证成功,未损坏。")  

            anno = _load_one_isat_json(json_file)
            annos[remove_file_suffix(file)] = anno

        except json.decoder.JSONDecodeError as e:  
            print(f"JSON文件 {json_file} 验证失败,已损坏。错误信息: {e}")  
            try:  
                os.remove(json_file)  
                files.remove(file)
                print(f"已删除损坏的JSON文件 {json_file}。")  
            except OSError as os_error:  
                print(f"删除损坏的JSON文件时发生错误: {os_error}")  

作者可以补充进去,为后续可能出现的其他崩溃做个损坏文件的过滤

@Joneedhome
Copy link
Author

在保存coco数据集的时候,可能会报错:Save COCO json error: Object of type int32 is not JSON serializable
经过查询是bbox的数据中有numpy类型的数据,添加转换代码:
coco.py中,coco_anno_info['bbox'] = [int(b) for b in coco_anno_info['bbox']]
可以解决这个问题。

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

1 participant