The error , please help me

I keep getting this error, but there is no problem with the numpy version and it is also compatible with pytorch

root@autodl-container-e3534eb58d-3a694e74:~# yolo detect train data = /tmp/pycharm_project_720/datasets.yaml model = /tmp/pycharm_project_720/yolo11n.pt epochs = 10 imgsz = 640 device = 0
Ultralytics 8.3.32 🚀 Python-3.8.10 torch-2.0.0+cu118 CUDA:0 (NVIDIA GeForce RTX 4090, 24210MiB)

engine/trainer: task=detect, mode=train, model=/tmp/pycharm_project_720/yolo11n.pt, data=/tmp/pycharm_project_720/datasets.yaml, epochs=10, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=0, workers=8, project=None, name=train3, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/train3
Overriding model.yaml nc=80 with nc=2

                   from  n    params  module                                       arguments                     
  0                  -1  1       464  ultralytics.nn.modules.conv.Conv             [3, 16, 3, 2]                 
  1                  -1  1      4672  ultralytics.nn.modules.conv.Conv             [16, 32, 3, 2]                
  2                  -1  1      6640  ultralytics.nn.modules.block.C3k2            [32, 64, 1, False, 0.25]      
  3                  -1  1     36992  ultralytics.nn.modules.conv.Conv             [64, 64, 3, 2]                
  4                  -1  1     26080  ultralytics.nn.modules.block.C3k2            [64, 128, 1, False, 0.25]     
  5                  -1  1    147712  ultralytics.nn.modules.conv.Conv             [128, 128, 3, 2]              
  6                  -1  1     87040  ultralytics.nn.modules.block.C3k2            [128, 128, 1, True]           
  7                  -1  1    295424  ultralytics.nn.modules.conv.Conv             [128, 256, 3, 2]              
  8                  -1  1    346112  ultralytics.nn.modules.block.C3k2            [256, 256, 1, True]           
  9                  -1  1    164608  ultralytics.nn.modules.block.SPPF            [256, 256, 5]                 
 10                  -1  1    249728  ultralytics.nn.modules.block.C2PSA           [256, 256, 1]                 
 11                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']          
 12             [-1, 6]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           
 13                  -1  1    111296  ultralytics.nn.modules.block.C3k2            [384, 128, 1, False]          
 14                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']          
 15             [-1, 4]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           
 16                  -1  1     32096  ultralytics.nn.modules.block.C3k2            [256, 64, 1, False]           
 17                  -1  1     36992  ultralytics.nn.modules.conv.Conv             [64, 64, 3, 2]                
 18            [-1, 13]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           
 19                  -1  1     86720  ultralytics.nn.modules.block.C3k2            [192, 128, 1, False]          
 20                  -1  1    147712  ultralytics.nn.modules.conv.Conv             [128, 128, 3, 2]              
 21            [-1, 10]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           
 22                  -1  1    378880  ultralytics.nn.modules.block.C3k2            [384, 256, 1, True]           
 23        [16, 19, 22]  1    431062  ultralytics.nn.modules.head.Detect           [2, [64, 128, 256]]           
YOLO11n summary: 319 layers, 2,590,230 parameters, 2,590,214 gradients, 6.4 GFLOPs

Transferred 448/499 items from pretrained weights
TensorBoard: Start with 'tensorboard --logdir runs/detect/train3', view at http://localhost:6006/
Freezing layer 'model.23.dfl.conv.weight'
AMP: running Automatic Mixed Precision (AMP) checks...
Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5.35M/5.35M [06:12<00:00, 15.1kB/s]
AMP: checks passed ✅


Traceback (most recent call last):
  File "/root/miniconda3/bin/yolo", line 8, in <module>
    sys.exit(entrypoint())
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/cfg/__init__.py", line 969, in entrypoint
    getattr(model, mode)(**overrides)  # default args from model
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/engine/model.py", line 802, in train
    self.trainer.train()
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/engine/trainer.py", line 207, in train
    self._do_train(world_size)
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/engine/trainer.py", line 322, in _do_train
    self._setup_train(world_size)
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/engine/trainer.py", line 286, in _setup_train
    self.train_loader = self.get_dataloader(self.trainset, batch_size=batch_size, rank=LOCAL_RANK, mode="train")
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/models/yolo/detect/train.py", line 49, in get_dataloader
    dataset = self.build_dataset(dataset_path, mode, batch_size)
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/models/yolo/detect/train.py", line 43, in build_dataset
    return build_yolo_dataset(self.args, img_path, batch, self.data, mode=mode, rect=mode == "val", stride=gs)
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/data/build.py", line 87, in build_yolo_dataset
    return dataset(
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/data/dataset.py", line 64, in __init__
    super().__init__(*args, **kwargs)
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/data/base.py", line 74, in __init__
    self.labels = self.get_labels()
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/data/dataset.py", line 138, in get_labels
    cache, exists = load_dataset_cache_file(cache_path), True  # attempt to load a *.cache file
  File "/root/miniconda3/lib/python3.8/site-packages/ultralytics/data/utils.py", line 659, in load_dataset_cache_file
    cache = np.load(str(path), allow_pickle=True).item()  # load dict
  File "/root/miniconda3/lib/python3.8/site-packages/numpy/lib/npyio.py", line 432, in load
    return format.read_array(fid, allow_pickle=allow_pickle,
  File "/root/miniconda3/lib/python3.8/site-packages/numpy/lib/format.py", line 792, in read_array
    array = pickle.load(fp, **pickle_kwargs)
ModuleNotFoundError: No module named 'numpy._core'

Try deleting any .cache files you find in the dataset directory.

1 Like

Thank you very much!!!