来源:chatGPT
问题:我们看到了两个UserWarning,他们一直重复,包括torchvision和albumentations,一个是环境配置有点问题,一个是没升级到最新版本,重点是影响美观,能跑就行。

D:\software\anaconda3\envs\yolov8\lib\site-packages\torchvision\io\image.py:11: UserWarning: Failed to load image Python extension: Could not find module 'D:\software\anaconda3\envs\yolov8\Lib\site-packages\torchvision\image.pyd' (or one of its dependencies). Try using the full path with constructor syntax.
  warn(f"Failed to load image Python extension: {e}")
D:\software\anaconda3\envs\yolov8\lib\site-packages\albumentations\__init__.py:13: UserWarning: A new version of Albumentations is available: 1.4.21 (you have 1.4.18). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.
  check_for_updates()
D:\software\anaconda3\envs\yolov8\lib\site-packages\torchvision\io\image.py:11: UserWarning: Failed to load image Python extension: Could not find module 'D:\software\anaconda3\envs\yolov8\Lib\site-packages\torchvision\image.pyd' (or one of its dependencies). Try using the full path with constructor syntax.
  warn(f"Failed to load image Python extension: {e}")
D:\software\anaconda3\envs\yolov8\lib\site-packages\albumentations\__init__.py:13: UserWarning: A new version of Albumentations is available: 1.4.21 (you have 1.4.18). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.
  check_for_updates()

解决办法:直接忽略就行。

import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="torchvision")
import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="albumentations")
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐