ndl-lab / ndlocr_cli

NDLOCRアプリケーションのリポジトリ(ソースコードを含む)
Creative Commons Attribution 4.0 International
358 stars 23 forks source link

not found epoch_180.pth #36

Closed mochacat2001 closed 2 months ago

mochacat2001 commented 2 months ago

tart inference ! input_root : /root/ocr_cli/input_root/ output_root : /root/ocr_cli/input_root/output/ config_file : config.yml [WARNING] Directory /root/ocr_cli/input_root/output already exist. [WARNING] Directory is changed to /root/ocr_cli/input_root/output_20240907072159. /usr/local/lib/python3.8/dist-packages/mmcv/init.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. warnings.warn( load from config=submodules/separate_pages_mmdet/models/cascade_rcnn_r50_fpn_1x_ndl_1024.py, checkpoint=submodules/separate_pages_mmdet/models/epoch_180.pth load checkpoint from local path: submodules/separate_pages_mmdet/models/epoch_180.pth Traceback (most recent call last): File "main.py", line 142, in main() File "main.py", line 138, in main cmd(obj={}) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 783, in invoke return __callback(args, *kwargs) File "/usr/local/lib/python3.8/dist-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), args, **kwargs) File "main.py", line 75, in infer inferrer = OcrInferrer(infer_cfg) File "/root/ocr_cli/cli/core/inference.py", line 60, in init self.proc_list = self._create_proc_list(cfg) File "/root/ocr_cli/cli/core/inference.py", line 493, in _create_proc_list proc_list.append(self.full_proc_list[i](cfg, i)) File "/root/ocr_cli/cli/procs/page_separation.py", line 35, in init self._detector = GutterDetector(config_path, checkpoint, device) File "/root/ocr_cli/submodules/separate_pages_mmdet/inference_divide.py", line 52, in init self.load(config, checkpoint, device) File "/root/ocr_cli/submodules/separate_pages_mmdet/inference_divide.py", line 58, in load self.model = init_detector(config, checkpoint, device) File "/usr/local/lib/python3.8/dist-packages/mmdet/apis/inference.py", line 46, in init_detector checkpoint = load_checkpoint(model, checkpoint, map_location='cpu') File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/checkpoint.py", line 638, in load_checkpoint checkpoint = _load_checkpoint(filename, map_location, logger) File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/checkpoint.py", line 572, in _load_checkpoint return CheckpointLoader.load_checkpoint(filename, map_location, logger) File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/checkpoint.py", line 314, in load_checkpoint return checkpoint_loader(filename, map_location) # type: ignore File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/checkpoint.py", line 333, in load_from_local raise FileNotFoundError(f'{filename} can not be found.') FileNotFoundError: submodules/separate_pages_mmdet/models/epoch_180.pth can not be found.

ndl-lab-staff commented 2 months ago

Hi, From reading your error, it appears that the model file is not correctly placed.

Did you build your container image using dockerbuild.sh or dockerbuild.bat? These scripts can download the model files automatically.

If you want to modify it manually, please download the model from epoch_180.pth and place it in /root/ocr_cli/submodules/separate_pages_mmdet/models/epoch_180.pth

mochacat2001 commented 2 months ago

Sorry. I solved myself, for some reason the model file was not downloaded in windows, so I downloaded it manually and placed it in the proper location and it worked. Thank you very much!