Closed fanshu-520 closed 10 months ago
出现同样问题,不知道什么情况
出现同样问题,不知道什么情况
因为cnocr更新到了2.3版本 而脚本需要的版本是2.2所以导致出现这个问题 解决方法是把2.3这个先删除 然后安装2.2的版本 pip uninstall cnocr pip install cnocr==2.2.4.2
并不能解决 仍然报错
File "E:\STARRA~1\STARRA~1\Honkai_Star_Rail.py", line 351, in select sra.main(option) File "E:\STARRA~1\STARRA~1\Honkai_Star_Rail.py", line 300, in main map_instance = map_word(game_title) ^^^^^^^^^^^^^^^^^^^^ File "E:\STARRA~1\STARRA~1\utils\map.py", line 20, in init self.calculated = calculated(title) ^^^^^^^^^^^^^^^^^ File "E:\STARRA~1\STARRA~1\utils\calculated.py", line 57, in init self.ocr = CnOcr(det_model_name=det_model_name, rec_model_name=rec_model_name, rec_vocab_fp="model/cnocr/label_cn.txt", det_root=os.path.join(dir, "model/cnstd"), rec_root=os.path.join(dir, "model/cnocr")) if not number else CnOcr(det_model_name=det_model_name, rec_model_name=rec_model_name,det_root="./model/cnstd", rec_root="./model/cnocr", cand_alphabet='0123456789') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\STARRA~1\STARRA~1\env\Lib\site-packages\cnocr\cn_ocr.py", line 155, in init self.rec_model = rec_cls( ^^^^^^^^ File "E:\STARRA~1\STARRA~1\env\Lib\site-packages\cnocr\recognizer.py", line 132, in init self._assert_and_prepare_model_files(model_fp, root) File "E:\STARRA~1\STARRA~1\env\Lib\site-packages\cnocr\recognizer.py", line 179, in _assert_and_prepare_model_files raise NotImplementedError( NotImplementedError: ('densenet_lite_114-fc', 'pytorch') is not a downloadable model
问题描述
cnocr更新了2.3版本 模型可能需要重新训练?
预期行为
正常运行
实际行为
报错
截图或录屏
自动锄大地脚本版本
1.8.7
星穹铁道区服
国服
运行的客户端
PC
日志
14:03:03 - INFO | get_width.get_width:50 - 0/20231005163817/20231005163817 - Real resolution: 1936 x 1119 x 1.0 x False 14:03:03 - INFO | honkai_star_rail.main:307 - 0/20231005163817/20231005163817 - 开始运行,请勿移动鼠标和键盘 14:03:03 - INFO | honkai_star_rail.main:308 - 0/20231005163817/20231005163817 - 若脚本运行无反应,请使用管理员权限运行 14:03:03 - ERROR | honkai_star_rail.:375 - 0/20231005163817/20231005163817 - Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\cnocr\recognizer.py", line 119, in init
self._assert_and_prepare_model_files(model_fp, root)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\cnocr\recognizer.py", line 179, in _assert_and_prepare_model_files
raise NotImplementedError(
NotImplementedError: ('densenet_lite_114-fc', 'onnx') is not a downloadable model
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Administrator\Desktop\StarRailAssistant-1.8.6\honkai_star_rail.py", line 368, in
select() if not serial_map else sra.main(start=serial_map)
^^^^^^^^
File "C:\Users\Administrator\Desktop\StarRailAssistant-1.8.6\honkai_star_rail.py", line 364, in select
is_loop = sra.main(option)
^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\Desktop\StarRailAssistant-1.8.6\honkai_star_rail.py", line 310, in main
map_instance = map_word(game_title)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\Desktop\StarRailAssistant-1.8.6\utils\map.py", line 22, in init
self.calculated = calculated(title)
^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\Desktop\StarRailAssistant-1.8.6\utils\calculated.py", line 60, in init
self.ocr = CnOcr(det_model_name=det_model_name, rec_model_name=rec_model_name, rec_vocab_fp="model/cnocr/label_cn.txt", det_root=det_root, rec_root=rec_root) if not number else CnOcr(det_model_name=det_model_name, rec_model_name=rec_model_name,det_root="./model/cnstd", rec_root="./model/cnocr", cand_alphabet='0123456789')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\cnocr\cn_ocr.py", line 155, in init
self.rec_model = rec_cls(
^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\cnocr\recognizer.py", line 132, in init
self._assert_and_prepare_model_files(model_fp, root)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\cnocr\recognizer.py", line 179, in _assert_and_prepare_model_files
raise NotImplementedError(
NotImplementedError: ('densenet_lite_114-fc', 'pytorch') is not a downloadable model