Skip to content

Commit

Permalink
add checks
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Mar 10, 2021
1 parent 8530f33 commit 98f9058
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from tqdm import tqdm

from models.common import Classify
from utils.general import set_logging, check_file, increment_path
from utils.general import set_logging, check_file, increment_path, check_git_status, check_requirements
from utils.torch_utils import model_info, select_device, is_parallel

# Settings
Expand Down Expand Up @@ -225,10 +225,16 @@ def test(model, dataloader, names, criterion=None, verbose=False, pbar=None):
parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
opt = parser.parse_args()

# Checks
check_git_status()
check_requirements()

# Parameters
device = select_device(opt.device, batch_size=opt.batch_size)
cuda = device.type != 'cpu'
opt.hyp = check_file(opt.hyp) # check files
opt.save_dir = increment_path(Path(opt.project) / opt.name, exist_ok=opt.exist_ok | opt.evolve) # increment run
resize = torch.nn.Upsample(size=(opt.img_size, opt.img_size), mode='bilinear', align_corners=False) # image resize

# Train
train()

0 comments on commit 98f9058

Please sign in to comment.