ultralytics / ultralytics

Ultralytics YOLO11 🚀
https://docs.ultralytics.com
GNU Affero General Public License v3.0
31.48k stars 6.05k forks source link

ERROR:albumentations.check_version:Error fetching version info #14729

Open monkeycc opened 3 months ago

monkeycc commented 3 months ago

Search before asking

Question


Ultralytics YOLOv8.2.66 🚀 Python-3.12.4 torch-2.3.1+cu118 CUDA:0 (NVIDIA GeForce RTX 3080 Ti Laptop GPU, 16384MiB)
engine\trainer: task=detect, mode=train, model=E:\2023_Code\YOLOv8\Yolov8_2024_Models\Detection\yolov8s.pt, data=E:\yolov8data\jc.yaml, epochs=20, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=jc_MB, name=jc_MB_640_S2, 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=False, 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, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=jc_MB\jc_MB_640_S2
Overriding model.yaml nc=80 with nc=2

                   from  n    params  module                                       arguments
  0                  -1  1       928  ultralytics.nn.modules.conv.Conv             [3, 32, 3, 2]
  1                  -1  1     18560  ultralytics.nn.modules.conv.Conv             [32, 64, 3, 2]
  2                  -1  1     29056  ultralytics.nn.modules.block.C2f             [64, 64, 1, True]
  3                  -1  1     73984  ultralytics.nn.modules.conv.Conv             [64, 128, 3, 2]
  4                  -1  2    197632  ultralytics.nn.modules.block.C2f             [128, 128, 2, True]
  5                  -1  1    295424  ultralytics.nn.modules.conv.Conv             [128, 256, 3, 2]
  6                  -1  2    788480  ultralytics.nn.modules.block.C2f             [256, 256, 2, True]
  7                  -1  1   1180672  ultralytics.nn.modules.conv.Conv             [256, 512, 3, 2]
  8                  -1  1   1838080  ultralytics.nn.modules.block.C2f             [512, 512, 1, True]
  9                  -1  1    656896  ultralytics.nn.modules.block.SPPF            [512, 512, 5]
 10                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']
 11             [-1, 6]  1         0  ultralytics.nn.modules.conv.Concat           [1]
 12                  -1  1    591360  ultralytics.nn.modules.block.C2f             [768, 256, 1]
 13                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']
 14             [-1, 4]  1         0  ultralytics.nn.modules.conv.Concat           [1]
 15                  -1  1    148224  ultralytics.nn.modules.block.C2f             [384, 128, 1]
 16                  -1  1    147712  ultralytics.nn.modules.conv.Conv             [128, 128, 3, 2]
 17            [-1, 12]  1         0  ultralytics.nn.modules.conv.Concat           [1]
 18                  -1  1    493056  ultralytics.nn.modules.block.C2f             [384, 256, 1]
 19                  -1  1    590336  ultralytics.nn.modules.conv.Conv             [256, 256, 3, 2]
 20             [-1, 9]  1         0  ultralytics.nn.modules.conv.Concat           [1]
 21                  -1  1   1969152  ultralytics.nn.modules.block.C2f             [768, 512, 1]
 22        [15, 18, 21]  1   2116822  ultralytics.nn.modules.head.Detect           [2, [128, 256, 512]]
Model summary: 225 layers, 11,136,374 parameters, 11,136,358 gradients, 28.6 GFLOPs

Transferred 349/355 items from pretrained weights
Freezing layer 'model.22.dfl.conv.weight'
AMP: running Automatic Mixed Precision (AMP) checks with YOLOv8n...
AMP: checks passed ✅
train: Scanning E:\yolov8data\2\02_zq_VOC\yoloOK\labels\train.cache... 665 images, 0 backgrounds, 0 corrupt: 100%|██████████| 665/665 [00:00<?, ?it/s]
ERROR:albumentations.check_version:Error fetching version info
Traceback (most recent call last):
  File "D:\anaconda3\envs\py312\Lib\urllib\request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "D:\anaconda3\envs\py312\Lib\http\client.py", line 1336, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "D:\anaconda3\envs\py312\Lib\http\client.py", line 1382, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "D:\anaconda3\envs\py312\Lib\http\client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "D:\anaconda3\envs\py312\Lib\http\client.py", line 1091, in _send_output
    self.send(msg)
  File "D:\anaconda3\envs\py312\Lib\http\client.py", line 1035, in send
    self.connect()
  File "D:\anaconda3\envs\py312\Lib\http\client.py", line 1470, in connect
    super().connect()
  File "D:\anaconda3\envs\py312\Lib\http\client.py", line 1001, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\py312\Lib\socket.py", line 853, in create_connection
    raise exceptions[0]
  File "D:\anaconda3\envs\py312\Lib\socket.py", line 838, in create_connection
    sock.connect(sa)
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\anaconda3\envs\py312\Lib\site-packages\albumentations\check_version.py", line 29, in fetch_version_info
    with opener.open(url, timeout=2) as response:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\py312\Lib\urllib\request.py", line 515, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\py312\Lib\urllib\request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\py312\Lib\urllib\request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "D:\anaconda3\envs\py312\Lib\urllib\request.py", line 1392, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\py312\Lib\urllib\request.py", line 1347, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error timed out>
albumentations: Blur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01), CLAHE(p=0.01, clip_limit=(1, 4.0), tile_grid_size=(8, 8))
val: Scanning E:\yolov8data\2\02_zq_VOC\yoloOK\labels\val.cache... 189 images, 0 backgrounds, 0 corrupt: 100%|██████████| 189/189 [00:00<?, ?it/s]
Plotting labels to jc_MB\jc_MB_640_S2\labels.jpg... 
optimizer: 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... 
optimizer: AdamW(lr=0.001667, momentum=0.9) with parameter groups 57 weight(decay=0.0), 64 weight(decay=0.0005), 63 bias(decay=0.0)
Image sizes 640 train, 640 val
Using 8 dataloader workers
Logging results to jc_MB\jc_MB_640_S2
Starting training for 20 epochs...

      Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size
       1/20      4.19G      1.285       2.41      1.466         27        640: 100%|██████████| 42/42 [00:08<00:00,  5.24it/s]
                 Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 6/6 [00:01<00:00,  4.65it/s]
                   all        189        249      0.617      0.709      0.717      0.428

path: E:/yolov8data/2/02_zq_VOC/yoloOK
train: images/train
val: images/val
test: 

names:
    0: A
    1: B

ultralytics-8.2.66 python3.11 win11

Additional

No response

pderrenger commented 3 months ago

@monkeycc it looks like you're encountering a timeout error while fetching version info for the albumentations library. This issue can sometimes occur due to network connectivity problems or restrictions.

To resolve this, you can try the following steps:

  1. Check Network Connection: Ensure that your internet connection is stable and there are no network restrictions or firewalls blocking the request.

  2. Update albumentations: Make sure you are using the latest version of the albumentations library. You can update it using:

    pip install --upgrade albumentations
  3. Disable Version Check: If the issue persists, you can disable the version check in albumentations by modifying the library's source code or by setting an environment variable to bypass this check.

  4. Retry Later: Sometimes, the issue might be temporary due to server-side problems. You can try running your training script again after some time.

If the problem continues, please ensure you are using the latest version of the Ultralytics package and all dependencies. If you still face issues, feel free to reach out again.

monkeycc commented 3 months ago
  1. The network is normal, but Chinese users cannot access websites such as GitHub

  2. albumentations pip install --upgrade albumentations It's already the latest version

3.Disable Version Check: If the issue persists, you can disable the version check in by modifying the library's source code or by setting an environment variable to bypass this check.albumentations

Please provide code examples

pderrenger commented 3 months ago

@monkeycc thank you for the information. Given the network restrictions, you can bypass the version check in albumentations by setting an environment variable. Add this to your script before importing albumentations:

import os
os.environ['ALBUMENTATIONS_DISABLE_VERSION_CHECK'] = '1'

This should prevent the library from attempting to fetch version info. If you continue to experience issues, please ensure you are using the latest version of the Ultralytics package.

vinojhosan commented 2 months ago

Hey, there is a change in variable name and this works

export NO_ALBUMENTATIONS_UPDATE=1

before the application starts

or

you can add this in your python code before import the library os.environ['NO_ALBUMENTATIONS_UPDATE'] = '1'

pderrenger commented 2 months ago

Thank you for the update. Setting the environment variable NO_ALBUMENTATIONS_UPDATE as you mentioned is indeed a valid approach to bypass the version check in albumentations. If you encounter any further issues, please ensure you are using the latest versions of all dependencies. If the problem persists, feel free to reach out again.