training_extensions icon indicating copy to clipboard operation
training_extensions copied to clipboard

Several models fail to download pretrained weights - ConnectionResetError

Open piotrgrubicki opened this issue 6 months ago • 10 comments

To ensure this problem can be easily reproduced, I deleted the container and its volumes, built the most recent image and started the container. The app started with a clean slate. Then:

  1. Create a detection project, upload images, annotate.
  2. Start a RT-DETR-R50 training.

It fails shortly afterwards. On another machine (with a long history), I am noticing the same errors for several more models. Other model, D-FINE-L, can be trained fine.

Piece of logs
2026-05-26 10:28:53.127 | INFO     | getitune.data.augmentation.intensity:build_intensity_transform:312 - Built intensity transform pipeline: [ScaleToUnit(max_value=255.0)]
2026-05-26 10:28:53.128 | INFO     | app.execution.training.getitune_trainer:train_model:399 - Instantiating the LightningModel for training (model_id=07745dd5-d273-41d6-8676-88ac73883091)
2026-05-26 10:28:57.425 | ERROR    | app.execution.base:_report_progress:122 - Failed: Train Model
Traceback (most recent call last):

  File "/usr/local/lib/python3.13/urllib/request.py", line 1319, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
    │ │       │   │             │   │         │   │     └ {'Host': 'storage.geti.intel.com', 'User-Agent': 'torch.hub', 'Connection': 'close'}
    │ │       │   │             │   │         │   └ <property object at 0x7bf3211da570>
    │ │       │   │             │   │         └ <urllib.request.Request object at 0x7bef2943bd90>
    │ │       │   │             │   └ '/weights/ResNet50_vd_ssld_v2_pretrained_from_paddle.pth'
    │ │       │   │             └ <urllib.request.Request object at 0x7bef2943bd90>
    │ │       │   └ <function Request.get_method at 0x7bf3211bf1a0>
    │ │       └ <urllib.request.Request object at 0x7bef2943bd90>
    │ └ <function HTTPConnection.request at 0x7bf3d0348cc0>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
  File "/usr/local/lib/python3.13/http/client.py", line 1358, in request
    self._send_request(method, url, body, headers, encode_chunked)
    │    │             │       │    │     │        └ False
    │    │             │       │    │     └ {'Host': 'storage.geti.intel.com', 'User-Agent': 'torch.hub', 'Connection': 'close'}
    │    │             │       │    └ None
    │    │             │       └ '/weights/ResNet50_vd_ssld_v2_pretrained_from_paddle.pth'
    │    │             └ 'GET'
    │    └ <function HTTPConnection._send_request at 0x7bf3d0348d60>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
  File "/usr/local/lib/python3.13/http/client.py", line 1404, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
    │    │          │                    └ False
    │    │          └ None
    │    └ <function HTTPConnection.endheaders at 0x7bf3d0348c20>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
  File "/usr/local/lib/python3.13/http/client.py", line 1353, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
    │    │            │                            └ False
    │    │            └ None
    │    └ <function HTTPConnection._send_output at 0x7bf3d03487c0>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
  File "/usr/local/lib/python3.13/http/client.py", line 1113, in _send_output
    self.send(msg)
    │    │    └ b'GET /weights/ResNet50_vd_ssld_v2_pretrained_from_paddle.pth HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: storage.geti.int...
    │    └ <function HTTPConnection.send at 0x7bf3d03485e0>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
  File "/usr/local/lib/python3.13/http/client.py", line 1057, in send
    self.connect()
    │    └ <function HTTPSConnection.connect at 0x7bf3d0348f40>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
  File "/usr/local/lib/python3.13/http/client.py", line 1492, in connect
    super().connect()
  File "/usr/local/lib/python3.13/http/client.py", line 1033, in connect
    self._tunnel()
    │    └ <function HTTPConnection._tunnel at 0x7bf3d0348360>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
  File "/usr/local/lib/python3.13/http/client.py", line 991, in _tunnel
    (version, code, message) = response._read_status()
                               │        └ <function HTTPResponse._read_status at 0x7bf3d032ac00>
                               └ <http.client.HTTPResponse object at 0x7bef2947de40>
  File "/usr/local/lib/python3.13/http/client.py", line 297, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               │    │           └ 65536
               │    └ None
               └ <http.client.HTTPResponse object at 0x7bef2947de40>
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           │    │               └ <memory at 0x7bef317beb00>
           │    └ None
           └ <socket.SocketIO object at 0x7bef2947e680>

ConnectionResetError: [Errno 104] Connection reset by peer


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_typehints.py", line 821, in adapt_typehints
    vals.append(adapt_typehints(val, subtypehint, **adapt_kwargs))
    │    │      │               │    │              └ {'serialize': False, 'instantiate_classes': True, 'prev_val': None, 'append': False, 'enable_path': False, 'sub_add_kwargs': ...
    │    │      │               │    └ <class 'NoneType'>
    │    │      │               └ {'class_path': 'getitune.backend.lightning.models.RTDETR', 'init_args': {'label_info': ['person', 'vehicle'], 'data_input_par...
    │    │      └ <function adapt_typehints at 0x7bf0bd7e4220>
    │    └ <method 'append' of 'list' objects>
    └ [URLError(ConnectionResetError(104, 'Connection reset by peer')), ValueError("Expected a <class 'NoneType'>. Got value: {'cla...
  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_typehints.py", line 1073, in adapt_typehints
    val = adapt_class_type(val, serialize, instantiate_classes, sub_add_kwargs, prev_val=prev_val)
          │                │    │          │                    │                        └ Namespace(class_path='getitune.backend.lightning.models.base.LightningModel')
          │                │    │          │                    └ {'fail_untyped': False, 'sub_configs': True, 'instantiate': True}
          │                │    │          └ True
          │                │    └ False
          │                └ Namespace(class_path='getitune.backend.lightning.models.RTDETR', init_args=Namespace(label_info=['person', 'vehicle'], data_i...
          └ <function adapt_class_type at 0x7bf0bd7e4e00>
  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_typehints.py", line 1392, in adapt_class_type
    return instantiator_fn(val_class, **{**init_args, **dict_kwargs})
           │               │               │            └ {}
           │               │               └ Namespace(label_info=['person', 'vehicle'], data_input_params={'input_size': (640, 640), 'mean': (0.0, 0.0, 0.0), 'std': (1.0...
           │               └ <class 'getitune.backend.lightning.models.detection.rtdetr.RTDETR'>
           └ <function default_class_instantiator at 0x7bef659211c0>
  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_common.py", line 155, in default_class_instantiator
    return class_type(*args, **kwargs)
           │           │       └ {'label_info': ['person', 'vehicle'], 'data_input_params': {'input_size': (640, 640), 'mean': (0.0, 0.0, 0.0), 'std': (1.0, 1...
           │           └ ()
           └ <class 'getitune.backend.lightning.models.detection.rtdetr.RTDETR'>
  File "/application/backend/.venv/lib/python3.13/site-packages/getitune/backend/lightning/models/detection/rtdetr.py", line 83, in __init__
    super().__init__(
  File "/application/backend/.venv/lib/python3.13/site-packages/getitune/backend/lightning/models/detection/base.py", line 87, in __init__
    super().__init__(
  File "/application/backend/.venv/lib/python3.13/site-packages/getitune/backend/lightning/models/base.py", line 187, in __init__
    self.model = self._create_model()
    │            │    └ <function RTDETR._create_model at 0x7bf235c8c680>
    │            └ RTDETR()
    └ RTDETR()
  File "/application/backend/.venv/lib/python3.13/site-packages/getitune/backend/lightning/models/detection/rtdetr.py", line 96, in _create_model
    backbone = PResNet(model_name=self.model_name)
               │                  │    └ 'rtdetr_50'
               │                  └ RTDETR()
               └ <class 'getitune.backend.lightning.models.detection.backbones.presnet.PResNet'>
  File "/application/backend/.venv/lib/python3.13/site-packages/getitune/backend/lightning/models/detection/backbones/presnet.py", line 405, in __new__
    return PResNetModule(**cls.PRESNET_CFG[model_name])
           │               │   │           └ 'rtdetr_50'
           │               │   └ {'rtdetr_18': {'depth': 18, 'pretrained': True, 'return_idx': [1, 2, 3]}, 'rtdetr_50': {'depth': 50, 'return_idx': [1, 2, 3],...
           │               └ <class 'getitune.backend.lightning.models.detection.backbones.presnet.PResNet'>
           └ <class 'getitune.backend.lightning.models.detection.backbones.presnet.PResNetModule'>
  File "/application/backend/.venv/lib/python3.13/site-packages/getitune/backend/lightning/models/detection/backbones/presnet.py", line 354, in __init__
    state = torch.hub.load_state_dict_from_url(self.donwload_url[depth])
            │     │   │                        │    │            └ 50
            │     │   │                        │    └ {18: 'https://storage.geti.intel.com/weights/ResNet18_vd_pretrained_from_paddle.pth', 34: 'https://storage.geti.intel.com/wei...
            │     │   │                        └ PResNetModule(
            │     │   │                            (conv1): Sequential(
            │     │   │                              (conv1_1): Conv2dModule(
            │     │   │                                (conv): PatchedConv2d(3, 32, kernel_size=(3, 3), str...
            │     │   └ <function load_state_dict_from_url at 0x7bf31deeea20>
            │     └ <module 'torch.hub' from '/application/backend/.venv/lib/python3.13/site-packages/torch/hub.py'>
            └ <module 'torch' from '/application/backend/.venv/lib/python3.13/site-packages/torch/__init__.py'>
  File "/application/backend/.venv/lib/python3.13/site-packages/torch/hub.py", line 880, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
    │                    │    │            │                     └ True
    │                    │    │            └ None
    │                    │    └ '/home/non-root/.cache/torch/hub/checkpoints/ResNet50_vd_ssld_v2_pretrained_from_paddle.pth'
    │                    └ 'https://storage.geti.intel.com/weights/ResNet50_vd_ssld_v2_pretrained_from_paddle.pth'
    └ <function download_url_to_file at 0x7bf31deee7a0>
  File "/application/backend/.venv/lib/python3.13/site-packages/torch/hub.py", line 736, in download_url_to_file
    with urlopen(req) as u:
         │       └ <urllib.request.Request object at 0x7bef2943bd90>
         └ <function urlopen at 0x7bf3211bca40>
  File "/usr/local/lib/python3.13/urllib/request.py", line 189, in urlopen
    return opener.open(url, data, timeout)
           │      │    │    │     └ <object object at 0x7bf3d276c6e0>
           │      │    │    └ None
           │      │    └ <urllib.request.Request object at 0x7bef2943bd90>
           │      └ <function OpenerDirector.open at 0x7bf3211bfa60>
           └ <urllib.request.OpenerDirector object at 0x7bef317f3230>
  File "/usr/local/lib/python3.13/urllib/request.py", line 489, in open
    response = self._open(req, data)
               │    │     │    └ None
               │    │     └ <urllib.request.Request object at 0x7bef2943bd90>
               │    └ <function OpenerDirector._open at 0x7bf3211bfb00>
               └ <urllib.request.OpenerDirector object at 0x7bef317f3230>
  File "/usr/local/lib/python3.13/urllib/request.py", line 506, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             │    │           │    │            │         └ 'https'
             │    │           │    │            └ 'https'
             │    │           │    └ {'http': [<urllib.request.ProxyHandler object at 0x7bef317f3380>, <urllib.request.HTTPHandler object at 0x7bef317f3620>], 'ht...
             │    │           └ <urllib.request.OpenerDirector object at 0x7bef317f3230>
             │    └ <function OpenerDirector._call_chain at 0x7bf3211bf9c0>
             └ <urllib.request.OpenerDirector object at 0x7bef317f3230>
  File "/usr/local/lib/python3.13/urllib/request.py", line 466, in _call_chain
    result = func(*args)
             │     └ (<urllib.request.Request object at 0x7bef2943bd90>,)
             └ <bound method HTTPSHandler.https_open of <urllib.request.HTTPSHandler object at 0x7bef29398050>>
  File "/usr/local/lib/python3.13/urllib/request.py", line 1367, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           │    │       │    │      │                └ <urllib.request.Request object at 0x7bef2943bd90>
           │    │       │    │      └ <class 'http.client.HTTPSConnection'>
           │    │       │    └ <module 'http.client' from '/usr/local/lib/python3.13/http/client.py'>
           │    │       └ <module 'http' from '/usr/local/lib/python3.13/http/__init__.py'>
           │    └ <function AbstractHTTPHandler.do_open at 0x7bf3211f5a80>
           └ <urllib.request.HTTPSHandler object at 0x7bef29398050>
  File "/usr/local/lib/python3.13/urllib/request.py", line 1322, in do_open
    raise URLError(err)
          └ <class 'urllib.error.URLError'>

urllib.error.URLError: <urlopen error [Errno 104] Connection reset by peer>


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.13/multiprocessing/spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
               │     │   └ 3
               │     └ 49
               └ <function _main at 0x7bf3d240a0c0>
  File "/usr/local/lib/python3.13/multiprocessing/spawn.py", line 135, in _main
    return self._bootstrap(parent_sentinel)
           │    │          └ 3
           │    └ <function BaseProcess._bootstrap at 0x7bf3d2539a80>
           └ <SpawnProcess name='job-train-a6696731-06dc-49ed-8a06-2f6e2cfe7f5d' parent=1 started>
  File "/usr/local/lib/python3.13/multiprocessing/process.py", line 313, in _bootstrap
    self.run()
    │    └ <function BaseProcess.run at 0x7bf3d2538fe0>
    └ <SpawnProcess name='job-train-a6696731-06dc-49ed-8a06-2f6e2cfe7f5d' parent=1 started>
  File "/usr/local/lib/python3.13/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    │    │        │    │        │    └ {}
    │    │        │    │        └ <SpawnProcess name='job-train-a6696731-06dc-49ed-8a06-2f6e2cfe7f5d' parent=1 started>
    │    │        │    └ (<app.core.run.runnable.RunnableFactory object at 0x7bf3d21d4980>, <JobType.TRAIN: 'train'>, 'train-a6696731-06dc-49ed-8a06-2...
    │    │        └ <SpawnProcess name='job-train-a6696731-06dc-49ed-8a06-2f6e2cfe7f5d' parent=1 started>
    │    └ <function _entrypoint at 0x7bf3cf31bb00>
    └ <SpawnProcess name='job-train-a6696731-06dc-49ed-8a06-2f6e2cfe7f5d' parent=1 started>

  File "/application/backend/app/core/jobs/exec/process_run.py", line 149, in _entrypoint
    runnable.run(ExecutionContext(payload=payload, report=report))
    │        │   │                        │               └ <function _entrypoint.<locals>.report at 0x7bf3d2439ee0>
    │        │   │                        └ '{"job_id":"a6696731-06dc-49ed-8a06-2f6e2cfe7f5d","project_id":"5380aaeb-ba3b-4ee9-b879-309b65ab52a7","model_architecture_id"...
    │        │   └ <class 'app.core.run.runnable.ExecutionContext'>
    │        └ <function Execution.run at 0x7bf0a396a0c0>
    └ <app.execution.training.getitune_trainer.GetiTuneTrainer object at 0x7bf3d2497770>

  File "/application/backend/app/execution/base.py", line 92, in run
    self.execute(self.parse_params(ctx))
    │    │       │    │            └ ExecutionContext(payload='{"job_id":"a6696731-06dc-49ed-8a06-2f6e2cfe7f5d","project_id":"5380aaeb-ba3b-4ee9-b879-309b65ab52a7...
    │    │       │    └ <function Execution.parse_params at 0x7bf0a3969f80>
    │    │       └ <app.execution.training.getitune_trainer.GetiTuneTrainer object at 0x7bf3d2497770>
    │    └ <function GetiTuneTrainer.execute at 0x7bef3a9bd8a0>
    └ <app.execution.training.getitune_trainer.GetiTuneTrainer object at 0x7bf3d2497770>

  File "/application/backend/app/execution/training/getitune_trainer.py", line 666, in execute
    trained_model_path, getitune_engine = self.train_model(
                                          │    └ <function GetiTuneTrainer.train_model at 0x7bef3a9bd3a0>
                                          └ <app.execution.training.getitune_trainer.GetiTuneTrainer object at 0x7bf3d2497770>

> File "/application/backend/app/execution/base.py", line 41, in wrapper
    result = func(self, *args, **kwargs)
             │    │      │       └ {'training_config': {'work_dir': '/application/backend', 'task': 'DETECTION', 'engine': {'checkpoint': None, 'device': <Devic...
             │    │      └ ()
             │    └ <app.execution.training.getitune_trainer.GetiTuneTrainer object at 0x7bf3d2497770>
             └ <function GetiTuneTrainer.train_model at 0x7bef3a9bd300>

  File "/application/backend/app/execution/training/getitune_trainer.py", line 410, in train_model
    getitune_model: LightningModel = model_parser.instantiate_classes(Namespace(model=model_cfg)).get("model")
                                     │            │                   │               └ {'class_path': 'getitune.backend.lightning.models.RTDETR', 'init_args': {'label_info': ['person', 'vehicle'], 'data_input_par...
                                     │            │                   └ <class 'jsonargparse._namespace.Namespace'>
                                     │            └ <function parse_as_dict_patch.<locals>.patched_instantiate_classes at 0x7bef65801440>
                                     └ ArgumentParser(prog='main.py', usage=None, description=None, formatter_class=<class 'jsonargparse._formatters.DefaultHelpForm...

  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_deprecated.py", line 140, in patched_instantiate_classes
    cfg = self._unpatched_instantiate_classes(cfg, **kwargs)
          │    │                              │      └ {}
          │    │                              └ Namespace(model={'class_path': 'getitune.backend.lightning.models.RTDETR', 'init_args': {'label_info': ['person', 'vehicle'],...
          │    └ <function ArgumentParser.instantiate_classes at 0x7bef65800360>
          └ ArgumentParser(prog='main.py', usage=None, description=None, formatter_class=<class 'jsonargparse._formatters.DefaultHelpForm...
  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_core.py", line 1204, in instantiate_classes
    parent[key] = component.instantiate_classes(value)
    │      │      │         │                   └ {'class_path': 'getitune.backend.lightning.models.RTDETR', 'init_args': {'label_info': ['person', 'vehicle'], 'data_input_par...
    │      │      │         └ <function ActionTypeHint.instantiate_classes at 0x7bef659bfe20>
    │      │      └ ActionTypeHint(option_strings=['--model'], dest='model', nargs=None, const=None, default=None, type=None, choices=None, requi...
    │      └ 'model'
    └ Namespace(model={'class_path': 'getitune.backend.lightning.models.RTDETR', 'init_args': {'label_info': ['person', 'vehicle'],...
  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_typehints.py", line 611, in instantiate_classes
    value[num] = adapt_typehints(
    │     │      └ <function adapt_typehints at 0x7bf0bd7e4220>
    │     └ 0
    └ [{'class_path': 'getitune.backend.lightning.models.RTDETR', 'init_args': {'label_info': ['person', 'vehicle'], 'data_input_pa...
  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_typehints.py", line 826, in adapt_typehints
    raise_union_unexpected_value(typehint, val, vals)
    │                            │         │    └ [URLError(ConnectionResetError(104, 'Connection reset by peer')), ValueError("Expected a <class 'NoneType'>. Got value: {'cla...
    │                            │         └ {'class_path': 'getitune.backend.lightning.models.RTDETR', 'init_args': {'label_info': ['person', 'vehicle'], 'data_input_par...
    │                            └ typing.Optional[getitune.backend.lightning.models.base.LightningModel]
    └ <function raise_union_unexpected_value at 0x7bf0bd7e4180>
  File "/application/backend/.venv/lib/python3.13/site-packages/jsonargparse/_typehints.py", line 710, in raise_union_unexpected_value
    raise ValueError(

ValueError: Does not validate against any of the Union subtypes
Subtypes: (<class 'getitune.backend.lightning.models.base.LightningModel'>, <class 'NoneType'>)
Errors:
  - <urlopen error [Errno 104] Connection reset by peer>
  - Expected a <class 'NoneType'>
Given value type: <class 'dict'>
Given value: {'class_path': 'getitune.backend.lightning.models.RTDETR', 'init_args': {'label_info': ['person', 'vehicle'], 'data_input_params': {'input_size': (640, 640), 'mean': (0.0, 0.0, 0.0), 'std': (1.0, 1.0, 1.0), 'intensity_config': {'storage_dtype': 'uint8', 'max_value': 255.0, 'mode': 'scale_to_unit', 'window_center': None, 'window_width': None, 'percentile_low': 1.0, 'percentile_high': 99.0, 'scale_factor': 1.0, 'min_value': 0.0, 'repeat_channels': 0}}, 'model_name': 'rtdetr_50', 'optimizer': {'class_path': 'torch.optim.AdamW', 'init_args': {'lr': 0.0001, 'betas': (0.9, 0.999), 'eps': 1e-08, 'weight_decay': 0.0001, 'amsgrad': False, 'maximize': False, 'capturable': False, 'differentiable': False}}, 'scheduler': {'class_path': 'getitune.backend.lightning.schedulers.LinearWarmupSchedulerCallable', 'init_args': {'main_scheduler_callable': {'class_path': 'lightning.pytorch.cli.ReduceLROnPlateau', 'init_args': {'monitor': 'val/map_50', 'mode': 'max', 'factor': 0.1, 'patience': 6, 'threshold': 0.0001, 'threshold_mode': 'rel', 'cooldown': 0, 'min_lr': 0.0, 'eps': 1e-08}}, 'num_warmup_steps': 100, 'warmup_interval': 'epoch'}}, 'metric': <function _mean_ap_f_measure_callable at 0x7bef5467efc0>, 'multi_scale': False, 'torch_compile': False, 'tile_config': {'enable_tiler': False, 'enable_adaptive_tiling': True, 'tile_size': (400, 400), 'overlap': 0.2, 'iou_threshold': 0.45, 'max_num_instances': 1500, 'object_tile_ratio': 0.03, 'sampling_ratio': 1.0}}}

piotrgrubicki avatar May 26 '26 10:05 piotrgrubicki

The ValueError: Does not validate against any of the Union subtypes error is misleading, it's raised because of another earlier exception that is not handled properly:

  File "/usr/local/lib/python3.13/urllib/request.py", line 1319, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
    │ │       │   │             │   │         │   │     └ {'Host': 'storage.geti.intel.com', 'User-Agent': 'torch.hub', 'Connection': 'close'}
    │ │       │   │             │   │         │   └ <property object at 0x7bf3211da570>
    │ │       │   │             │   │         └ <urllib.request.Request object at 0x7bef2943bd90>
    │ │       │   │             │   └ '/weights/ResNet50_vd_ssld_v2_pretrained_from_paddle.pth'
    │ │       │   │             └ <urllib.request.Request object at 0x7bef2943bd90>
    │ │       │   └ <function Request.get_method at 0x7bf3211bf1a0>
    │ │       └ <urllib.request.Request object at 0x7bef2943bd90>
    │ └ <function HTTPConnection.request at 0x7bf3d0348cc0>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
  ...
  File "/usr/local/lib/python3.13/http/client.py", line 1113, in _send_output
    self.send(msg)
    │    │    └ b'GET /weights/ResNet50_vd_ssld_v2_pretrained_from_paddle.pth HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: storage.geti.int...
    │    └ <function HTTPConnection.send at 0x7bf3d03485e0>
    └ <http.client.HTTPSConnection object at 0x7bef293981a0>
...
  File "/usr/local/lib/python3.13/http/client.py", line 297, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               │    │           └ 65536
               │    └ None
               └ <http.client.HTTPResponse object at 0x7bef2947de40>
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           │    │               └ <memory at 0x7bef317beb00>
           │    └ None
           └ <socket.SocketIO object at 0x7bef2947e680>

ConnectionResetError: [Errno 104] Connection reset by peer

The traceback indicates that torch.hub was downloading the model weights when suddenly the connection was closed before the HTTP response completed. I can't pinpoint the exact reason why it happened, possible causes could be:

  • Connection was closed by proxy/firewall due to timeout or file size too large
  • Connection was closed by storage.geti.intel.com (restart, rate limiting, ...)
  • A network interruption - less likely since it's reported to happen frequently

I can't reproduce the issue on my local Docker-based deployment, while I do in servers in the internal network.

leoll2 avatar May 26 '26 13:05 leoll2

@AlbertvanHouten can you take a look at this issue? As mentioned before, it can be only reproduced consistently when all the following are true:

  • Model is RT-DETR-R50 (EDIT: or one of the other models listed below)
  • Geti runs as Docker container in one of our BMs

The odd part is that the same weight file can be successfully downloaded in the same BM but outside of the container, with a simple script like:

from torch.hub import download_url_to_file
download_url_to_file("https://storage.geti.intel.com/weights/ResNet50_vd_ssld_v2_pretrained_from_paddle.pth", "/tmp/weights.pth", None, progress=True)

which is the same function that getitune calls internally.

leoll2 avatar May 26 '26 15:05 leoll2

I made several more attempts. The same error for: ATSS-MobileNet-V2, DINOv3-DETR-L, SSD-MobileNet-V2, Mask-RCNN-ResNet50, DINOv2-Small It works for: Mask-RCNN-Swin-T, MobileNet-V3-Large Though, it may be random.

piotrgrubicki avatar May 27 '26 07:05 piotrgrubicki

Another interesting finding: the issue doesn't occur in the BMs when Geti is started with standalone server/UI without Docker.

leoll2 avatar May 28 '26 15:05 leoll2

@leoll2 - I noticed the same error when testing various classification/detection models on Linux version of the Geti. This error - connection reset by peer - appeared when I tried to run training for bigger models for the first time - during downloading models. Second attempt of the training always succeeded. Possible cause might be that in this second try we had already some part of this model downloaded - so it downloads less data - and the error doesn't appear. Maybe we could consider retrying this download - let's say three times - when this particular error appears?

jcchr avatar Jun 03 '26 09:06 jcchr

And another issue related to this error - from time to time (not in all occurrences) - when this error appears - the model disappears from the list of models (it should be presented with Failed status) - so a user doesn't know what happened.

jcchr avatar Jun 03 '26 09:06 jcchr

Maybe we could consider retrying this download - let's say three times - when this particular error appears?

That's a good suggestion, I will check if retrying helps to mitigate the issue.

when this error appears - the model disappears from the list of models

This happens because the failure occurs before a model is created. I agree it's a UX problem, tracked here: https://github.com/open-edge-platform/training_extensions/issues/6668

leoll2 avatar Jun 03 '26 11:06 leoll2

The issue should be mitigated now that #6657 is merged. For technical reasons explained in the PR, it can't be fully solved until #5100.

leoll2 avatar Jun 10 '26 11:06 leoll2

@itallix After the pretrained weights refactoring is complete, please review and close this issue.

leoll2 avatar Jul 16 '26 07:07 leoll2

/home/non-root/.cache/torch/hub/checkpoints is no longer used, as all weights are now managed from the app and via the app's data folder. Some models previously relied on this directory existing, which caused containerized setups to fail if the path wasn't pre-created properly.

itallix avatar Jul 20 '26 12:07 itallix