DpythonProjectvenvScriptspythonexe DpythonProjectOCR-PRJocr-remotepy Traceback most recent call last File DpythonProjectOCR-PRJocr-remotepy line 1 in module from cnocr import CnOcr File DpythonPr
This error is occurring because the cnocr package is unable to import the ConvBNActivation class from the torchvision.models.mobilenetv2 module. This can happen if there is an issue with the installation of the torchvision package or if there are version compatibility issues between the cnocr and torchvision packages.
To fix this error, you can try the following steps:
-
Check if the
torchvisionpackage is installed correctly. You can do this by runningpip listin your terminal and looking fortorchvisionin the list of installed packages. If it is not installed, you can install it by runningpip install torchvision. -
Check if there are any version compatibility issues between the
cnocrandtorchvisionpackages. You can do this by checking the version requirements ofcnocrandtorchvisionin their respective documentation. If there are version compatibility issues, you can try upgrading or downgrading one or both packages to a compatible version. -
If the above steps do not work, you can try uninstalling and reinstalling both the
cnocrandtorchvisionpackages to ensure a clean installation.
Once you have resolved the issue with the torchvision.models.mobilenetv2 module, the cnocr package should be able to import the ConvBNActivation class and the error should be resolved.
原文地址: https://www.cveoy.top/t/topic/7xp 著作权归作者所有。请勿转载和采集!