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

when I run ''python visual_interface.py'',it shows this error,I don't know how to solve it. #51

Closed GeXu66 closed 3 years ago

GeXu66 commented 3 years ago

(py3.8) 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 256, in init self.predict_handler_thread = PredictHandlerThread(self.input_player, 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\py3.8\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\py3.8\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

The reason is your weight path is not correct , pls read this: 如何使用可视化工具

GeXu66 commented 3 years ago

The reason is your weight path is not correct , pls read this: 如何使用可视化工具

But I just put the .pt file in the weights folder.The weights path is correct.