You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
*** for yolov8 seg model model = YOLO("yolov8s-seg.pt"), how to solve the following error.
I run model offline. ***
Transferred 411/417 items from pretrained weights
TensorBoard: Start with 'tensorboard --logdir runs/segment/train33', view at http://localhost:6006/
Freezing layer 'model.22.dfl.conv.weight'
AMP: running Automatic Mixed Precision (AMP) checks with YOLOv8n...
RuntimeError Traceback (most recent call last)
Cell In[10], line 1
----> 1 results = model.train(data="cell_data.yaml",
2 epochs=2,
3 workers=1,
4 batch=8,
5 imgsz=640)
File ~/venv_example/lib/python3.8/site-packages/ultralytics/engine/model.py:338, in Model.train(self, trainer, **kwargs)
336 self.model = self.trainer.model
337 self.trainer.hub_session = self.session # attach optional HUB session
--> 338 self.trainer.train()
339 # Update model and cfg after training
340 if RANK in (-1, 0):
File ~/venv_example/lib/python3.8/site-packages/ultralytics/engine/trainer.py:190, in BaseTrainer.train(self)
187 ddp_cleanup(self, str(file))
189 else:
--> 190 self._do_train(world_size)
File ~/venv_example/lib/python3.8/site-packages/ultralytics/engine/trainer.py:286, in BaseTrainer._do_train(self, world_size)
284 if world_size > 1:
285 self._setup_ddp(world_size)
--> 286 self._setup_train(world_size)
288 self.epoch_time = None
289 self.epoch_time_start = time.time()
File ~/venv_example/lib/python3.8/site-packages/ultralytics/engine/trainer.py:232, in BaseTrainer._setup_train(self, world_size)
230 if self.amp and RANK in (-1, 0): # Single-GPU and DDP
231 callbacks_backup = callbacks.default_callbacks.copy() # backup callbacks as check_amp() resets them
--> 232 self.amp = torch.tensor(check_amp(self.model), device=self.device)
233 callbacks.default_callbacks = callbacks_backup # restore callbacks
234 if RANK > -1 and world_size > 1: # DDP
File ~/venv_example/lib/python3.8/site-packages/ultralytics/utils/checks.py:606, in check_amp(model)
604 try:
605 from ultralytics import YOLO
--> 606 assert amp_allclose(YOLO('yolov8n.pt'), im)
607 LOGGER.info(f'{prefix}checks passed ✅')
608 except ConnectionError:
File ~/venv_example/lib/python3.8/site-packages/ultralytics/utils/checks.py:594, in check_amp..amp_allclose(m, im)
592 def amp_allclose(m, im):
593 """All close FP32 vs AMP results."""
--> 594 a = m(im, device=device, verbose=False)[0].boxes.data # FP32 inference
595 with torch.cuda.amp.autocast(True):
596 b = m(im, device=device, verbose=False)[0].boxes.data # AMP inference
File ~/venv_example/lib/python3.8/site-packages/ultralytics/engine/model.py:98, in Model.call(self, source, stream, **kwargs)
96 def call(self, source=None, stream=False, **kwargs):
97 """Calls the 'predict' function with given arguments to perform object detection."""
---> 98 return self.predict(source, stream, **kwargs)
File ~/venv_example/lib/python3.8/site-packages/ultralytics/engine/model.py:232, in Model.predict(self, source, stream, predictor, **kwargs)
230 if not self.predictor:
231 self.predictor = (predictor or self._smart_load('predictor'))(overrides=args, _callbacks=self.callbacks)
--> 232 self.predictor.setup_model(model=self.model, verbose=is_cli)
233 else: # only update args if predictor is already setup
234 self.predictor.args = get_cfg(self.predictor.args, args)
File ~/venv_example/lib/python3.8/site-packages/ultralytics/engine/predictor.py:317, in BasePredictor.setup_model(self, model, verbose)
315 def setup_model(self, model, verbose=True):
316 """Initialize YOLO model with given parameters and set it to evaluation mode."""
--> 317 self.model = AutoBackend(model or self.args.model,
318 device=select_device(self.args.device, verbose=verbose),
319 dnn=self.args.dnn,
320 data=self.args.data,
321 fp16=self.args.half,
322 fuse=True,
323 verbose=verbose)
325 self.device = self.model.device # update device
326 self.args.half = self.model.fp16 # update half
File ~/venv_example/lib/python3.8/site-packages/torch/utils/_contextlib.py:115, in context_decorator..decorate_context(*args, **kwargs)
112 @functools.wraps(func)
113 def decorate_context(*args, **kwargs):
114 with ctx_factory():
--> 115 return func(*args, **kwargs)
File ~/venv_example/lib/python3.8/site-packages/ultralytics/nn/autobackend.py:115, in AutoBackend.init(self, weights, device, dnn, data, fp16, fuse, verbose)
113 if nn_module: # in-memory PyTorch model
114 model = weights.to(device)
--> 115 model = model.fuse(verbose=verbose) if fuse else model
116 if hasattr(model, 'kpt_shape'):
117 kpt_shape = model.kpt_shape # pose-only
File ~/venv_example/lib/python3.8/site-packages/ultralytics/nn/tasks.py:129, in BaseModel.fuse(self, verbose)
127 if isinstance(m, Conv2):
128 m.fuse_convs()
--> 129 m.conv = fuse_conv_and_bn(m.conv, m.bn) # update conv
130 delattr(m, 'bn') # remove batchnorm
131 m.forward = m.forward_fuse # update forward
File ~/venv_example/lib/python3.8/site-packages/ultralytics/utils/torch_utils.py:172, in fuse_conv_and_bn(conv, bn)
170 w_conv = conv.weight.clone().view(conv.out_channels, -1)
171 w_bn = torch.diag(bn.weight.div(torch.sqrt(bn.eps + bn.running_var)))
--> 172 fusedconv.weight.copy_(torch.mm(w_bn, w_conv).view(fusedconv.weight.shape))
174 # Prepare spatial bias
175 b_conv = torch.zeros(conv.weight.size(0), device=conv.weight.device) if conv.bias is None else conv.bias
RuntimeError: CUDA error: CUBLAS_STATUS_NOT_INITIALIZED when calling
cublasCreate(handle)
Beta Was this translation helpful? Give feedback.
All reactions