reformat code
This commit is contained in:
1 parent
b35f76e3d0
commit
f5da528d28
5 files changed
+15
-13
No files matched your search
+1
-1
@@ -423,7 +423,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
||||
ne += 1 # print('empty labels for image %s' % self.img_files[i]) # file empty
|
||||
# os.system("rm '%s' '%s'" % (self.img_files[i], self.label_files[i])) # remove
|
||||
|
||||
if rank in [-1,0]:
|
||||
if rank in [-1, 0]:
|
||||
pbar.desc = 'Scanning labels %s (%g found, %g missing, %g empty, %g duplicate, for %g images)' % (
|
||||
cache_path, nf, nm, ne, nd, n)
|
||||
if nf == 0:
|
||||
|
||||
@@ -12,6 +12,7 @@ import torchvision.models as models
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def init_seeds(seed=0):
|
||||
torch.manual_seed(seed)
|
||||
|
||||
@@ -43,7 +44,7 @@ def select_device(device='', batch_size=None):
|
||||
if i == 1:
|
||||
s = ' ' * len(s)
|
||||
logger.info("%sdevice%g _CudaDeviceProperties(name='%s', total_memory=%dMB)" %
|
||||
(s, i, x[i].name, x[i].total_memory / c))
|
||||
(s, i, x[i].name, x[i].total_memory / c))
|
||||
else:
|
||||
logger.info('Using CPU')
|
||||
|
||||
@@ -144,7 +145,8 @@ def model_info(model, verbose=False):
|
||||
except:
|
||||
fs = ''
|
||||
|
||||
logger.info('Model Summary: %g layers, %g parameters, %g gradients%s' % (len(list(model.parameters())), n_p, n_g, fs))
|
||||
logger.info(
|
||||
'Model Summary: %g layers, %g parameters, %g gradients%s' % (len(list(model.parameters())), n_p, n_g, fs))
|
||||
|
||||
|
||||
def load_classifier(name='resnet101', n=2):
|
||||
|
||||
Reference in new issue
Block a user