问题1:weights_only
FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
torch.load
可能出现torch.load(file, map_location="cpu", weights_only=True)
如果weights_only=True,或者不存在weights_only
就将其改成
torch.load(file, map_location="cpu", weights_only=True)
如果在结束时候又出现这个问题,请在
同上,在报错的文件后追加代码语句“, weights_only=False”,详情如下所示:
(1)根据报错代码,找到倒数第二个file,ctrl+单击进入第484行代码。
修改前:
x = torch.load(f, map_location=torch.device("cpu"))#原始代码
修改后的代码:
x = torch.load(f, map_location=torch.device("cpu"), weights_only=False)
方法2:
查找环境是否错误,重新安装pip install -r requirements.txt
问题2 val:ignoring corrupt image/label: Label class 2 exceeds dataset class count 1. Possible class labels are 0-0 WARNING ⚠️ D:\YOLOV8\aa\images\val\video_0053_frame_115.jpg: 这些警告信息说明了在验证集(val)中,有一些图像或标签文件存在问题。
具体来说,警告的内容是 "Label class 2 exceeds dataset class count 1",这意味着标签文件中出现了类别 2。
但是你的数据集只包含类别 0,因此模型无法处理这些标签。修改数据集即可
问题3.出现终端可以运行,但是run不可以运行

点击编辑修改环默认值,修改到正确的路径
浙公网安备 33010602011771号