Traceback (most recent call last): File "main.py", line 13, in <module> import datasets File "/public/home/ac2ax5rex7/projects/lift/detr-main/datasets/__init__.py", line 5, in <module> from .coco import build as build_coco File "/public/home/ac2ax5rex7/projects/lift/detr-main/datasets/coco.py", line 14, in <module> import datasets.transforms as T File "/public/home/ac2ax5rex7/projects/lift/detr-main/datasets/transforms.py", line 13, in <module> from util.misc import interpolate File "/public/home/ac2ax5rex7/projects/lift/detr-main/util/misc.py", line 22, in <module> if version.parse(torchvision.__version__) < version.parse('0.7'): File "/public/home/ac2ax5rex7/miniconda3/envs/detr/lib/python3.8/site-packages/packaging/version.py", line 52, in parse return Version(version) File "/public/home/ac2ax5rex7/miniconda3/envs/detr/lib/python3.8/site-packages/packaging/version.py", line 198, in __init__ raise InvalidVersion(f"Invalid version: '{version}'") packaging.version.InvalidVersion: Invalid version: '0.10.0a0-dtk22.04+e17f5ea'
时间: 2023-08-20 21:05:39 浏览: 440
这是一个 Python 错误信息,出现在执行 "main.py" 文件时。看起来这个错误是由于在 "util/misc.py" 文件中尝试使用 "torchvision.__version__" ,但是版本号解析失败导致的。错误信息中显示版本号为 "0.10.0a0-dtk22.04+e17f5ea",这个版本号可能不符合标准的版本号格式,因此无法被正确解析。建议检查代码中对 "torchvision" 的依赖版本,或者尝试升级 "torchvision" 到最新版本。
相关问题
python main.py Traceback (most recent call last): File "main.py", line 2, in <module> import myframe File "/home/yolov5_dirver_detacte/myframe.py", line 4, in <module> import mydetect #yolo检测 File "/home/yolov5_dirver_detacte/mydetect.
py", line 2, in <module> import torch File "/usr/local/lib/python3.6/dist-packages/torch/__init__.py", line 81, in <module> ctypes.CDLL(dll) File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__ self._handle = _dlopen(self._name, mode) OSError: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudart.so.10.1: cannot allocate memory in static TLS block
这个错误是由于没有足够的内存来分配静态 TLS 块导致的。您可以尝试增加系统的虚拟内存限制或者释放一些内存。如果你是在 GPU 上运行程序,也可以尝试减少显存的使用。
Traceback (most recent call last): File "main.py", line 2, in <module> import myframe File "/home/yolov5_dirver_detacte/myframe.py", line 5, in <module> import myfatigue #疲劳检测 File "/home/yolov5_dirver_detacte/myfatigue.py", line 4, in <module> from imutils.video import FileVideoStream ModuleNotFoundError: No module named 'imutils'
这个错误提示说明你的代码运行需要使用 imutils 库,但是你的环境中没有安装这个库。你可以通过运行以下命令来安装这个库:
```
pip install imutils
```
安装完毕后再次运行代码即可。
阅读全文