如何解决问题:“torch_jit_internal.py:853: UserWarning:无法检索...的源”

问题描述 投票:0回答:1

我正在创建一个使用 yolov8 来检测对象的应用程序。当我通过pyinstaller成功将py文件转换为exe文件,然后运行exe文件时,每当我按下按钮检测对象时,控制台都会重复显示下面的脚本并创建一个新会话(图片:enter image description here)。

torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
torch\_jit_internal.py:853: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x0000021C83CC8700>.
  warnings.warn(
torch\_jit_internal.py:853: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x0000021C83CC8940>.
  warnings.warn(

我的代码:

pyinstaller .\run.py -c -D
当我将 py 转换为 exe 时,输出终端显示:

...
4466 INFO: Caching module dependency graph...
4597 INFO: Running Analysis Analysis-00.toc
4597 INFO: Looking for Python shared library...
4607 INFO: Using Python shared library: C:\Users\thang\AppData\Local\Programs\Python\Python39\python39.dll
4607 INFO: Analyzing D:\MATERIAL\Intern_VNPT\NV3\Test\run.py
4618 INFO: Loading module hook 'hook-PyQt5.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
4742 INFO: Loading module hook 'hook-cv2.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
4774 INFO: Loading module hook 'hook-numpy.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\Lib\\site-packages\\numpy\\_pyinstaller'...
5324 INFO: Loading module hook 'hook-difflib.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
5496 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
5624 INFO: Loading module hook 'hook-xml.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
6105 INFO: Loading module hook 'hook-platform.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
6390 INFO: Loading module hook 'hook-sysconfig.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
6814 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
8081 INFO: Loading module hook 'hook-matplotlib.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
8447 INFO: Loading module hook 'hook-packaging.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
8549 INFO: Processing pre-safe import module hook gi from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-gi.py'.
8622 INFO: Loading module hook 'hook-PIL.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
8689 INFO: Loading module hook 'hook-PIL.Image.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
9370 INFO: Loading module hook 'hook-pycparser.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
9816 INFO: Processing pre-safe import module hook distutils from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-distutils.py'.
9816 INFO: Processing pre-find module path hook distutils from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
10282 INFO: Loading module hook 'hook-distutils.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
10322 INFO: Loading module hook 'hook-distutils.util.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
10483 INFO: Loading module hook 'hook-setuptools.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
450 WARNING: Failed to collect submodules for 'setuptools._vendor.jaraco.text' because importing 'setuptools._vendor.jaraco.text' raised: ModuleNotFoundError: No module named 'setuptools.extern.jaraco'
12796 INFO: Loading module hook 'hook-pkg_resources.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
340 WARNING: Failed to collect submodules for 'pkg_resources._vendor.jaraco.text' because importing 'pkg_resources._vendor.jaraco.text' raised: ModuleNotFoundError: No module named 'pkg_resources.extern.jaraco'
15052 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
15600 INFO: Loading module hook 'hook-jinja2.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
17009 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
17439 INFO: Processing pre-safe import module hook six.moves from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
18736 INFO: Loading module hook 'hook-IPython.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
21011 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
21197 INFO: Loading module hook 'hook-pygments.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
23220 INFO: Loading module hook 'hook-importlib_metadata.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
24925 INFO: Loading module hook 'hook-wcwidth.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
25945 INFO: Loading module hook 'hook-jedi.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
26948 INFO: Loading module hook 'hook-parso.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
27968 INFO: Loading module hook 'hook-sqlite3.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
28969 INFO: Loading module hook 'hook-certifi.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
28983 INFO: Loading module hook 'hook-pytest.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
29187 INFO: Loading module hook 'hook-py.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
30268 INFO: Loading module hook 'hook-torch.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
41815 INFO: Loading module hook 'hook-scipy.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
43029 INFO: Loading module hook 'hook-scipy.sparse.csgraph.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
43192 INFO: Loading module hook 'hook-scipy.linalg.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
46702 INFO: Loading module hook 'hook-scipy.spatial.transform.rotation.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
55502 INFO: Loading module hook 'hook-pandas.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
57124 INFO: Loading module hook 'hook-pytz.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
59318 INFO: Loading module hook 'hook-pandas.io.formats.style.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
62325 INFO: Loading module hook 'hook-openpyxl.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
66039 INFO: Loading module hook 'hook-pandas.plotting.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
76707 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
77732 INFO: Loading module hook 'hook-scipy.io.matlab.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
78769 INFO: Loading module hook 'hook-h5py.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
79277 INFO: Loading module hook 'hook-torchvision.ops.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
81244 INFO: Processing pre-safe import module hook win32com from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
81346 INFO: Loading module hook 'hook-win32com.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
81354 INFO: Loading module hook 'hook-pythoncom.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
81464 INFO: Loading module hook 'hook-pywintypes.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85711 INFO: Processing pre-safe import module hook tensorflow from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-tensorflow.py'.
89387 INFO: Loading module hook 'hook-skimage.filters.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
90911 INFO: Loading module hook 'hook-skimage.transform.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
91567 INFO: Loading module hook 'hook-skimage.feature.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
91837 INFO: Loading module hook 'hook-sklearn.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
92450 INFO: Loading module hook 'hook-sklearn.utils.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
93531 INFO: Loading module hook 'hook-sklearn.cluster.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
93547 INFO: Loading module hook 'hook-sklearn.metrics.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
93594 INFO: Loading module hook 'hook-sklearn.metrics.cluster.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
93767 INFO: Loading module hook 'hook-sklearn.metrics.pairwise.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
93923 INFO: Loading module hook 'hook-sklearn.neighbors.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
94048 INFO: Loading module hook 'hook-sklearn.linear_model.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
97053 INFO: Processing module hooks...
97101 INFO: Loading module hook 'hook-zope.interface.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
97492 WARNING: Hidden import "sklearn.neighbors._typedefs" not found!
97494 INFO: Loading module hook 'hook-sklearn.tree.py' from 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
97763 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
97779 INFO: Matplotlib backend selection method: automatic discovery of used backends
97788 INFO: Discovered Matplotlib backend(s) via `matplotlib.use()` call in module 'sympy.testing.runtests': ['Agg', 'Agg']
97810 INFO: The following Matplotlib backends were discovered by scanning for `matplotlib.use()` calls: ['Agg', 'Agg']. If your backend of choice is not in this list, either add a `matplotlib.use()` call to your code, or configure the backend collection via hook options (see: https://pyinstaller.org/en/stable/hooks-config.html#matplotlib-hooks).
97810 INFO: Selected matplotlib backends: ['Agg', 'Agg']
98709 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
101596 INFO: Loading module hook 'hook-PyQt5.Qt.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
101604 INFO: Loading module hook 'hook-PyQt5.QtBluetooth.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
101696 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
101878 INFO: Loading module hook 'hook-PyQt5.QtDBus.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
101994 INFO: Loading module hook 'hook-PyQt5.QtDesigner.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
102126 WARNING: QtLibraryInfo(PyQt5): could not find translations with base name 'designer'! These translations will not be collected.
102126 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
102477 INFO: Loading module hook 'hook-PyQt5.QtHelp.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
102590 INFO: Loading module hook 'hook-PyQt5.QtLocation.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
102724 INFO: Loading module hook 'hook-PyQt5.QtMultimedia.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
102850 INFO: Loading module hook 'hook-PyQt5.QtMultimediaWidgets.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
102948 INFO: Loading module hook 'hook-PyQt5.QtNetwork.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
103284 INFO: Loading module hook 'hook-PyQt5.QtNfc.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
103386 INFO: Loading module hook 'hook-PyQt5.QtOpenGL.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
103501 INFO: Loading module hook 'hook-PyQt5.QtPositioning.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
103606 INFO: Loading module hook 'hook-PyQt5.QtPrintSupport.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
103732 INFO: Loading module hook 'hook-PyQt5.QtQml.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104000 INFO: Loading module hook 'hook-PyQt5.QtQuick.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104139 INFO: Loading module hook 'hook-PyQt5.QtQuick3D.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104250 INFO: Loading module hook 'hook-PyQt5.QtQuickWidgets.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104360 INFO: Loading module hook 'hook-PyQt5.QtRemoteObjects.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104455 INFO: Loading module hook 'hook-PyQt5.QtSensors.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104567 INFO: Loading module hook 'hook-PyQt5.QtSerialPort.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104686 INFO: Loading module hook 'hook-PyQt5.QtSql.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104797 INFO: Loading module hook 'hook-PyQt5.QtSvg.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
104926 INFO: Loading module hook 'hook-PyQt5.QtTest.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105022 INFO: Loading module hook 'hook-PyQt5.QtTextToSpeech.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105124 INFO: Loading module hook 'hook-PyQt5.QtWebChannel.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105227 INFO: Loading module hook 'hook-PyQt5.QtWebSockets.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105320 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105447 INFO: Loading module hook 'hook-PyQt5.QtWinExtras.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105565 INFO: Loading module hook 'hook-PyQt5.QtXml.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105659 INFO: Loading module hook 'hook-PyQt5.QtXmlPatterns.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105786 INFO: Loading module hook 'hook-scipy.special._ellip_harm_2.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105786 INFO: Loading module hook 'hook-scipy.special._ufuncs.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105786 INFO: Loading module hook 'hook-scipy.stats._stats.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
105820 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks'...
159731 INFO: Looking for ctypes DLLs
159818 WARNING: Ignoring /usr/lib64/libgomp.so.1 imported from D:\MATERIAL\Intern_VNPT\NV3\Test\environment\lib\site-packages\torch\_inductor\codecache.py - only basenames are supported with ctypes imports!
159840 INFO: Analyzing run-time hooks ...
159876 INFO: Including run-time hook 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
159887 INFO: Including run-time hook 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
159892 INFO: Including run-time hook 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
159894 INFO: Including run-time hook 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32comgenpy.py'
159894 INFO: Processing pre-find module path hook _pyi_rth_utils from 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-_pyi_rth_utils.py'.
159909 INFO: Including run-time hook 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_pywintypes.py'
159909 INFO: Including run-time hook 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_pythoncom.py'
159909 INFO: Including run-time hook 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_traitlets.py'
159926 INFO: Including run-time hook 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_mplconfig.py'
159926 INFO: Including run-time hook 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_setuptools.py'
159926 INFO: Including run-time hook 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
159926 INFO: Including run-time hook 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pyqt5.py'
160765 INFO: Looking for dynamic libraries
D:\MATERIAL\Intern_VNPT\NV3\Test\environment\lib\site-packages\PyInstaller\building\build_main.py:194: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
  __import__(package)
C:\Users\thang\AppData\Local\Programs\Python\Python39\lib\trio\_core\_multierror.py:511: RuntimeWarning: You seem to already have a custom sys.excepthook handler installed. I'll skip installing Trio's custom handler, but this means MultiErrors will not show full tracebacks.
  warnings.warn(
D:\MATERIAL\Intern_VNPT\NV3\Test\environment\lib\site-packages\torchvision\datapoints\__init__.py:12: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta. While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue: https://github.com/pytorch/vision/issues/6753, and you can also check out https://github.com/pytorch/vision/issues/7319 to learn more about the APIs that we suspect might involve future changes. You can silence this warning by calling torchvision.disable_beta_transforms_warning().
  warnings.warn(_BETA_TRANSFORMS_WARNING)
D:\MATERIAL\Intern_VNPT\NV3\Test\environment\lib\site-packages\torchvision\transforms\v2\__init__.py:54: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta. While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue: https://github.com/pytorch/vision/issues/6753, and you can also check out https://github.com/pytorch/vision/issues/7319 to learn more about the APIs that we suspect might involve future changes. You can silence this warning by calling torchvision.disable_beta_transforms_warning().
  warnings.warn(_BETA_TRANSFORMS_WARNING)
170996 INFO: Extra DLL search directories (AddDllDirectory): ['D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\numpy\\.libs', 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\Lib\\cv2\\../../x64/vc14/bin', 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\torch\\lib', 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\torchvision', 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\torchvision', 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\torchvision', 'D:\\MATERIAL\\Intern_VNPT\\NV3\\Test\\environment\\lib\\site-packages\\torchvision', 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\bin', 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\scipy.libs']
170996 INFO: Extra DLL search directories (PATH): ['C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\bin', 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\Lib\\cv2\\../../x64/vc14/bin']
180182 WARNING: Library not found: could not resolve 'Qt53DLogic.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtQuick\\Scene3D\\qtquickscene3dplugin.dll'.
180182 WARNING: Library not found: could not resolve 'Qt53DRender.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtQuick\\Scene3D\\qtquickscene3dplugin.dll'.
180186 WARNING: Library not found: could not resolve 'Qt53DAnimation.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtQuick\\Scene3D\\qtquickscene3dplugin.dll'.
180186 WARNING: Library not found: could not resolve 'Qt53DCore.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtQuick\\Scene3D\\qtquickscene3dplugin.dll'.
180186 WARNING: Library not found: could not resolve 'Qt53DInput.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtQuick\\Scene3D\\qtquickscene3dplugin.dll'.
180187 WARNING: Library not found: could not resolve 'Qt53DQuickScene2D.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtQuick\\Scene2D\\qtquickscene2dplugin.dll'.
180187 WARNING: Library not found: could not resolve 'Qt53DRender.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtQuick\\Scene2D\\qtquickscene2dplugin.dll'.
180187 WARNING: Library not found: could not resolve 'Qt53DCore.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtQuick\\Scene2D\\qtquickscene2dplugin.dll'.
180187 WARNING: Library not found: could not resolve 'Qt5MultimediaQuick.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\qml\\QtMultimedia\\declarative_multimedia.dll'.
180187 WARNING: Library not found: could not resolve 'LIBPQ.dll', dependency of 'C:\\Users\\thang\\AppData\\Local\\Programs\\Python\\Python39\\lib\\PyQt5\\Qt5\\plugins\\sqldrivers\\qsqlpsql.dll'.
180894 INFO: Warnings written to D:\MATERIAL\Intern_VNPT\NV3\Test\build\run\warn-run.txt
181552 INFO: Graph cross-reference written to D:\MATERIAL\Intern_VNPT\NV3\Test\build\run\xref-run.html
182084 INFO: checking PYZ
182264 INFO: checking PKG
182264 INFO: Building because toc changed
182264 INFO: Building PKG (CArchive) run.pkg
182323 INFO: Building PKG (CArchive) run.pkg completed successfully.
182324 INFO: Bootloader D:\MATERIAL\Intern_VNPT\NV3\Test\environment\lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\run.exe
182324 INFO: checking EXE
182324 INFO: Building because toc changed
182326 INFO: Building EXE from EXE-00.toc
182326 INFO: Copying bootloader EXE to D:\MATERIAL\Intern_VNPT\NV3\Test\build\run\run.exe
182413 INFO: Copying icon to EXE
182485 INFO: Copying 0 resources to EXE
182485 INFO: Embedding manifest in EXE
182551 INFO: Appending PKG archive to EXE
182585 INFO: Fixing EXE headers
183282 INFO: Building EXE from EXE-00.toc completed successfully.
183605 INFO: checking COLLECT
183796 INFO: Building COLLECT COLLECT-00.toc
209141 INFO: Building COLLECT COLLECT-00.toc completed successfully.

如何解决这个问题?我期待着你的到来

python pyqt5 pyinstaller torch torchvision
1个回答
0
投票

就我而言,Pyinstaller 处理多处理的方式存在限制。因此,即使进行了这些修复,您还必须在主文件中添加下面的代码,并冻结支持:

if __name__ == '__main__':
    import multiprocessing
    # Call freeze_support or Pyinstaller will recursively fork infinite processes forever
    multiprocessing.freeze_support()
© www.soinside.com 2019 - 2024. All rights reserved.