mirror of
https://github.com/ultralytics/ultralytics
synced 2026-04-21 14:07:18 +00:00
Simplify engine resume tests (#24183)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
cf95678dc8
commit
2283438618
2 changed files with 8 additions and 18 deletions
|
|
@ -262,6 +262,9 @@ lakshantha@ultralytics.com:
|
|||
lakshanthad@yahoo.com:
|
||||
avatar: https://avatars.githubusercontent.com/u/20147381?v=4
|
||||
username: lakshanthad
|
||||
lli28@nd.edu:
|
||||
avatar: https://avatars.githubusercontent.com/u/126812331?v=4
|
||||
username: easyrider11
|
||||
lukasbuligonantunes@gmail.com:
|
||||
avatar: https://avatars.githubusercontent.com/u/48484445?v=4
|
||||
username: Buligon
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import sys
|
|||
from types import SimpleNamespace
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from tests import MODEL, SOURCE
|
||||
|
|
@ -57,15 +58,8 @@ def test_detect():
|
|||
assert len(result), "predictor test failed"
|
||||
|
||||
# Test resume functionality
|
||||
overrides["resume"] = trainer.last
|
||||
trainer = detect.DetectionTrainer(overrides=overrides)
|
||||
try:
|
||||
trainer.train()
|
||||
except Exception as e:
|
||||
print(f"Expected exception caught: {e}")
|
||||
return
|
||||
|
||||
raise Exception("Resume test failed!")
|
||||
with pytest.raises(AssertionError):
|
||||
detect.DetectionTrainer(overrides={**overrides, "resume": trainer.last}).train()
|
||||
|
||||
|
||||
def test_segment():
|
||||
|
|
@ -103,15 +97,8 @@ def test_segment():
|
|||
assert len(result), "predictor test failed"
|
||||
|
||||
# Test resume functionality
|
||||
overrides["resume"] = trainer.last
|
||||
trainer = segment.SegmentationTrainer(overrides=overrides)
|
||||
try:
|
||||
trainer.train()
|
||||
except Exception as e:
|
||||
print(f"Expected exception caught: {e}")
|
||||
return
|
||||
|
||||
raise Exception("Resume test failed!")
|
||||
with pytest.raises(AssertionError):
|
||||
segment.SegmentationTrainer(overrides={**overrides, "resume": trainer.last}).train()
|
||||
|
||||
|
||||
def test_classify():
|
||||
|
|
|
|||
Loading…
Reference in a new issue