先找到虚拟环境下的这个文件:envs\xxxxx\Lib\site-packages\paddle\dataset\image.py
注释掉以下代码。

# 注释掉以下代码。
# if six.PY3:
#     import subprocess
#     import sys
#     import os
#     interpreter = sys.executable
#     # Note(zhouwei): if use Python/C 'PyRun_SimpleString', 'sys.executable'
#     # will be the C++ execubable on Windows
#     if sys.platform == 'win32' and 'python.exe' not in interpreter:
#         interpreter = sys.exec_prefix + os.sep + 'python.exe'
#     import_cv2_proc = subprocess.Popen([interpreter, "-c", "import cv2"],
#                                        stdout=subprocess.PIPE,
#                                        stderr=subprocess.PIPE)
#     out, err = import_cv2_proc.communicate()
#     retcode = import_cv2_proc.poll()
#     if retcode != 0:
#         cv2 = None
#     else:
#         try:
#             import cv2
#         except ImportError:
#             cv2 = None
# else:
try:
    import cv2
except ImportError:
    cv2 = None

注释掉后,重新打包,再将虚拟环境中的paddle和skimage复制到当前目录下才行。
不然还是会报错。

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐