你好: 我将该代码下载到了本地,并进行了调试,表明可以使用,但是断网了之后就不能用了,python中的modelscope库必须联网才能使用吗? 报错如下: Traceback (most recent call last): File "E:\Pytorch_code\modelscope-ocr-text-spotting\OCR_Plugin.py", line 207, in widget = ImageOCR() File "E:\Pytorch_code\modelscope-ocr-text-spotting\OCR_Plugin.py", line 33, in init self.ocr_detection = pipeline(Tasks.ocr_detection, model='damo/cv_resnet18_ocr-detection-line-level_damo') File "D:\software\python3.10\lib\site-packages\modelscope\pipelines\builder.py", line 100, in pipeline model = normalize_model_input(model, model_revision) File "D:\software\python3.10\lib\site-packages\modelscope\pipelines\builder.py", line 25, in normalize_model_input if isinstance(model, str) and is_official_hub_path(model, model_revision): File "D:\software\python3.10\lib\site-packages\modelscope\pipelines\util.py", line 41, in is_official_hub_path return is_official_hub_impl(path) File "D:\software\python3.10\lib\site-packages\modelscope\pipelines\util.py", line 38, in is_official_hub_impl raise ValueError(f'invalid model repo path {e}')
ValueError: invalid model repo path HTTPConnectionPool(host='www.modelscope.cn', port=80): Max retries exceeded with url: /api/v1/models/damo/cv_resnet18_ocr-detection-line-level_damo (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001B77880F760>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
可以离线使用哈,请查阅文档
https://modelscope.cn/docs/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98#Q5%EF%BC%9AModelScope%20%E6%A8%A1%E5%9E%8B%E7%9A%84%E4%BD%BF%E7%94%A8%E4%BE%9D%E8%B5%96%E4%BA%8E%E4%BA%92%E8%81%94%E7%BD%91%E8%BF%9E%E6%8E%A5%E5%90%97%EF%BC%9F%3Cbr%3E