PeterH0323 / Smart_Construction

Base on YOLOv5 Head Person Helmet Detection on Construction Sites,基于目标检测工地安全帽和禁入危险区域识别系统,🚀😆附 YOLOv5 训练自己的数据集超详细教程🚀😆2021.3新增可视化界面❗❗
GNU General Public License v3.0
2.19k stars 464 forks source link

Some errors:当我pip install -r requirements.txt 后,运行报错 #49

Closed GeXu66 closed 3 years ago

GeXu66 commented 3 years ago

Traceback (most recent call last): File "visual_interface.py", line 464, in weight_root = [str(weight_file[0])] # 权重文件位置 IndexError: list index out of range

(pytorch) E:\Smart_Construction-master>python visual_interface.py QFont::setPointSize: Point size <= 0 (-1), must be greater than 0 QFont::setPointSize: Point size <= 0 (-1), must be greater than 0 qt.qpa.fonts: Unable to open default EUDC font: "EUDC.TTE" Using CUDA device0 _CudaDeviceProperties(name='GeForce MX230', total_memory=2048MB)

Traceback (most recent call last): File "visual_interface.py", line 471, in main_window = MainWindow(weight_root, out_file_root, real_time_show_predict) File "visual_interface.py", line 268, in init real_time_show_predict_flag File "visual_interface.py", line 115, in init self.predict_model = YOLOPredict(weight_path, out_file_path) File "E:\Smart_Construction-master\detect_visual.py", line 41, in init self.model, self.half, self.names, self.colors, self.device = self.load_model() File "E:\Smart_Construction-master\detect_visual.py", line 59, in load_model model = attempt_load(weights, map_location=device) # load FP32 model File "E:\Smart_Construction-master\models\experimental.py", line 133, in attempt_load model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval()) # load FP32 model File "D:\ANACONDA\envs\pytorch\lib\site-packages\torch\serialization.py", line 592, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "D:\ANACONDA\envs\pytorch\lib\site-packages\torch\serialization.py", line 851, in _load result = unpickler.load() AttributeError: Can't get attribute 'C3' on <module 'models.common' from 'E:\Smart_Construction-master\models\common.py'>

PeterH0323 commented 3 years ago

权重路径问题,详见 如何使用可视化工具