python train.py
Traceback (most recent call last):
File "train.py", line 24, in <module>
import test # import test.py to get mAP after each epoch
File "/home/user3/yolov5/yolov5/test.py", line 13, in <module>
from models.experimental import attempt_load
File "/home/user3/yolov5/yolov5/models/experimental.py", line 7, in <module>
from models.common import Conv, DWConv
File "/home/user3/yolov5/yolov5/models/common.py", line 9, in <module>
from utils.datasets import letterbox
File "/home/user3/yolov5/yolov5/utils/datasets.py", line 17, in <module>
from utils.general import xyxy2xywh, xywh2xyxy, torch_distributed_zero_first
File "/home/user3/yolov5/yolov5/utils/general.py", line 28, in <module>
from utils.torch_utils import is_parallel, init_torch_seeds
File "/home/user3/yolov5/yolov5/utils/torch_utils.py", line 11, in <module>
import torchvision
File "/usr/local/lib/python3.8/site-packages/torchvision/__init__.py", line 7, in <module>
from torchvision import datasets
File "/usr/local/lib/python3.8/site-packages/torchvision/datasets/__init__.py", line 6, in <module>
from .mnist import MNIST, EMNIST, FashionMNIST, KMNIST, QMNIST
File "/usr/local/lib/python3.8/site-packages/torchvision/datasets/mnist.py", line 11, in <module>
import lzma
File "/usr/local/lib/python3.8/lzma.py", line 27, in <module>
from _lzma import *
ModuleNotFoundError: No module named '_lzma'
OS: [centos7]
GPU [tesla v100]
python_version [3.8.3]
cuda [9.2]
torch [1.7.0]
torchvison [0.8.1]
yolov5 [v3.1]
yum install xz-devel
yum install python-backports-lzma
pip install backports.lzma
cd /usr/local/lib/python3.8
vi lzma.py
modify about line 27
try:
from _lzma import *
from _lzma import _encode_filter_properties, _decode_filter_properties
except ImportError:
from backports.lzma import *
from backports.lzma import _encode_filter_properties, _decode_filter_properties```