Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/zhxk/sufan/PLATE/1.30/1.30/weigh11_23/localcheck_checking.py", line 138, in load_check myJudge.update(moment, detects, frame,camera) # 按照跟踪结果,作出判断 #frame File "/home/zhxk/sufan/PLATE/1.30/1.30/weigh11_23/load_judge.py", line 145, in update one.plate_num(cropped) File "/home/zhxk/sufan/PLATE/Car_recognition-master/one.py", line 259, in plate_num detect_model = load_model(detect_model, device) # 初始化检测模型 File "/home/zhxk/sufan/PLATE/Car_recognition-master/one.py", line 63, in load_model model = attempt_load(weights, map_location=device) # load FP32 model File "/home/zhxk/sufan/PLATE/Car_recognition-master/models1/experimental.py", line 121, in attempt_load model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval()) # load FP32 model File "/home/zhxk/.local/lib/python3.8/site-packages/torch/serialization.py", line 607, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/zhxk/.local/lib/python3.8/site-packages/torch/serialization.py", line 882, in _load result = unpickler.load() File "/home/zhxk/.local/lib/python3.8/site-packages/torch/serialization.py", line 875, in find_class return super().find_class(mod_name, name)
时间: 2023-12-13 20:06:06 浏览: 222
linux 下 pip3 报错“ File “/usr/bin/pip3”, line 9, in from pip import mainImportError: canno”处理
5星 · 资源好评率100%
这个错误是由于在加载模型时出现的。根据错误信息,似乎是在加载模型的过程中无法找到所需的类或属性。
可能的原因是在加载模型时,使用了一个不存在的类或属性。请检查加载模型的代码,确保它所依赖的类或属性是正确的,并且已经导入到了代码中。
另外,还要确保模型文件存在并且路径正确。如果模型文件不存在或路径不正确,也会导致加载模型失败。
如果以上检查都没有问题,那么可能是模型文件本身出现了问题。你可以尝试重新下载或获取正确的模型文件,并将其替换原有的模型文件。
如果问题仍然存在,请提供更多的代码和错误信息,以便我能够更好地帮助你解决问题。
阅读全文