AttributeError: module 'ddddocr' has no attribute 'DdddOcr'
时间: 2023-08-04 07:05:19 浏览: 151
AttributeError: module 'tensorflow.compat.v1' has no attribute '
引用\[1\]: 今天在使用huggingface的transformers时,却出现了AttributeError: module transformers has no attribute LLaMATokenizer的错误提示。引用\[2\]: 本文主要介绍了AttributeError: module transformers has no attribute LLaMATokenizer解决方案,希望能对使用LLaMA模型的同学有所帮助。引用\[3\]:方案一,修改ddddocr的_init_.py文件,将其中的ANTIALIAS替换为新方法: # image = image.resize((int(image.size\[0\] * (64 / image.size\[1\])), 64), Image.ANTIALIAS).convert('L') image = image.resize((int(image.size\[0\] * (64 / image.size\[1\])), 64), Image.LANCZOS).convert('L')。
问题:AttributeError: module 'ddddocr' has no attribute 'DdddOcr'
回答: 这个错误提示表明在模块'ddddocr'中找不到'DdddOcr'属性。要解决这个问题,可以尝试以下几个步骤:首先,确保你已经正确安装了'ddddocr'模块。其次,检查你的代码中是否正确导入了'ddddocr'模块。最后,如果以上步骤都没有解决问题,可以尝试修改'ddddocr'模块的_init_.py文件,将其中的ANTIALIAS替换为新方法Image.LANCZOS。这样可能会解决该错误。\[3\]
#### 引用[.reference_title]
- *1* *2* [AttributeError: module transformers has no attribute LLaMATokenizer解决方案](https://blog.csdn.net/weixin_43178406/article/details/129939966)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [AttributeError: module ‘PIL.Image‘ has no attribute ‘ANTIALIAS](https://blog.csdn.net/light2081/article/details/131517132)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文