ultralytics 8.1.15 add Python 3.12 compatibility (#8210)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Johnny <johnnynuca14@gmail.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
e38c7a3022
commit
fbed8499da
13 changed files with 47 additions and 40 deletions
|
|
@ -81,7 +81,7 @@ from ultralytics.utils import (
|
|||
get_default_args,
|
||||
yaml_save,
|
||||
)
|
||||
from ultralytics.utils.checks import check_imgsz, check_is_path_safe, check_requirements, check_version
|
||||
from ultralytics.utils.checks import PYTHON_VERSION, check_imgsz, check_is_path_safe, check_requirements, check_version
|
||||
from ultralytics.utils.downloads import attempt_download_asset, get_github_assets
|
||||
from ultralytics.utils.files import file_size, spaces_in_path
|
||||
from ultralytics.utils.ops import Profile
|
||||
|
|
@ -609,10 +609,8 @@ class Exporter:
|
|||
ct_model = cto.palettize_weights(ct_model, config=config)
|
||||
if self.args.nms and self.model.task == "detect":
|
||||
if mlmodel:
|
||||
import platform
|
||||
|
||||
# coremltools<=6.2 NMS export requires Python<3.11
|
||||
check_version(platform.python_version(), "<3.11", name="Python ", hard=True)
|
||||
check_version(PYTHON_VERSION, "<3.11", name="Python ", hard=True)
|
||||
weights_dir = None
|
||||
else:
|
||||
ct_model.save(str(f)) # save otherwise weights_dir does not exist
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class BaseTrainer:
|
|||
batch_size = self.batch_size // max(world_size, 1)
|
||||
self.train_loader = self.get_dataloader(self.trainset, batch_size=batch_size, rank=RANK, mode="train")
|
||||
if RANK in (-1, 0):
|
||||
# NOTE: When training DOTA dataset, double batch size could get OOM cause some images got more than 2000 objects.
|
||||
# Note: When training DOTA dataset, double batch size could get OOM on images with >2000 objects.
|
||||
self.test_loader = self.get_dataloader(
|
||||
self.testset, batch_size=batch_size if self.args.task == "obb" else batch_size * 2, rank=-1, mode="val"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue