ultralytics 8.0.152 bump torch>=1.8.0 (#4299)

This commit is contained in:
Glenn Jocher
2023-08-11 00:49:55 +02:00
committed by GitHub
parent 6267d6a609
commit 28893d9d2d
23 changed files with 30 additions and 30 deletions

View File

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = '8.0.151'
__version__ = '8.0.152'
from ultralytics.hub import start
from ultralytics.models import RTDETR, SAM, YOLO

View File

@ -598,11 +598,11 @@ def attempt_load_weights(weights, device=None, inplace=True, fuse=False):
# Append
ensemble.append(model.fuse().eval() if fuse and hasattr(model, 'fuse') else model.eval()) # model in eval mode
# Module compatibility updates
# Module updates
for m in ensemble.modules():
t = type(m)
if t in (nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6, nn.SiLU, Detect, Segment):
m.inplace = inplace # torch 1.7.0 compatibility
m.inplace = inplace
elif t is nn.Upsample and not hasattr(m, 'recompute_scale_factor'):
m.recompute_scale_factor = None # torch 1.11.0 compatibility
@ -634,11 +634,11 @@ def attempt_load_one_weight(weight, device=None, inplace=True, fuse=False):
model = model.fuse().eval() if fuse and hasattr(model, 'fuse') else model.eval() # model in eval mode
# Module compatibility updates
# Module updates
for m in model.modules():
t = type(m)
if t in (nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6, nn.SiLU, Detect, Segment):
m.inplace = inplace # torch 1.7.0 compatibility
m.inplace = inplace
elif t is nn.Upsample and not hasattr(m, 'recompute_scale_factor'):
m.recompute_scale_factor = None # torch 1.11.0 compatibility

View File

@ -215,7 +215,7 @@ def check_font(font='Arial.ttf'):
return file
def check_python(minimum: str = '3.7.0') -> bool:
def check_python(minimum: str = '3.8.0') -> bool:
"""
Check current python version against the required minimum version.

View File

@ -288,7 +288,7 @@ def safe_download(url,
unzip_dir = dir or f.parent # unzip to dir if provided else unzip in place
if is_zipfile(f):
unzip_dir = unzip_file(file=f, path=unzip_dir) # unzip
unzip_dir = unzip_file(file=f, path=unzip_dir, progress=progress) # unzip
elif f.suffix in ('.tar', '.gz'):
LOGGER.info(f'Unzipping {f} to {unzip_dir.resolve()}...')
subprocess.run(['tar', 'xf' if f.suffix == '.tar' else 'xfz', f, '--directory', unzip_dir], check=True)