-
Notifications
You must be signed in to change notification settings - Fork 3
/
Semi_train.py
480 lines (409 loc) · 22.1 KB
/
Semi_train.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
import os
from os import listdir
from os.path import join
import torch
from scipy.io import loadmat
from torch import nn
from torch.utils.data import DataLoader
from models.UNet import UNet_reg, UNet_seg
from models.XMorpher import Head
from utils.STN import SpatialTransformer, Re_SpatialTransformer
from utils.augmentation import MirrorTransform, SpatialTransform
from utils.dataloader import DatasetFromFolder3D
from utils.dataloader_test import DatasetFromFolder3D_Test
from utils.losses import gradient_loss, ncc_loss, crossentropy, MSE, mask_crossentropy, dice_loss
from utils.utils import EMA, AverageMeter, to_categorical, dice
import numpy as np
class RSeg(object):
def __init__(self, k=0, n_channels=1, n_classes=8, lr=1e-4, epoches=200, iters=200, batch_size=1, model_name='PC_XMorpher_heart_0'):
super(RSeg, self).__init__()
self.k = k
self.n_classes = n_classes
self.epoches = epoches
self.iters=iters
self.lr = lr
train_labeled_unlabeled_dir = 'data/train_labeled_unlabeled'
train_unlabeled_unlabeled_dir = 'data/train_unlabeled_unlabeled'
test_labeled_labeled_dir = 'data/test'
self.results_dir = 'results'
self.checkpoint_dir = 'weights'
self.model_name = model_name
# data augmentation
self.mirror_aug = MirrorTransform()
self.spatial_aug = SpatialTransform(do_rotation=True,
angle_x=(-np.pi / 9, np.pi / 9),
angle_y=(-np.pi / 9, np.pi / 9),
angle_z=(-np.pi / 9, np.pi / 9),
do_scale=True,
scale=(0.75, 1.25))
# init the network
self.Reger = Head(n_channels=n_classes-1)
self.Seger = UNet_seg(n_channels=n_channels, n_classes=n_classes)
if torch.cuda.is_available():
self.Reger = self.Reger.cuda()
self.Seger = self.Seger.cuda()
self.optR = torch.optim.Adam(self.Reger.parameters(), lr=lr)
self.optS = torch.optim.Adam(self.Seger.parameters(), lr=lr)
self.stn = SpatialTransformer()
self.rstn = Re_SpatialTransformer()
self.softmax = nn.Softmax(dim=1)
# init the data iterator
train_labeled_unlabeled_dataset = DatasetFromFolder3D(train_labeled_unlabeled_dir, n_classes)
self.dataloader_labeled_unlabeled = DataLoader(train_labeled_unlabeled_dataset, batch_size=batch_size, shuffle=True)
train_unlabeled_unlabeled_dataset = DatasetFromFolder3D(train_unlabeled_unlabeled_dir, n_classes)
self.dataloader_unlabeled_unlabeled = DataLoader(train_unlabeled_unlabeled_dataset, batch_size=batch_size, shuffle=True)
Test_labeled_labeled_dataset = DatasetFromFolder3D_Test(test_labeled_labeled_dir, n_classes)
self.dataloader_labeled_labeled = DataLoader(Test_labeled_labeled_dataset, batch_size=batch_size, shuffle=False)
# define loss
self.L_smooth = gradient_loss
self.L_ncc = ncc_loss
self.L_seg = crossentropy
# define loss log
self.L_smooth_log = AverageMeter(name='L_smooth')
self.L_ncc_log = AverageMeter(name='L_ncc')
self.L_w_log = AverageMeter(name='L_w')
self.L_anchor_log = AverageMeter(name='L_anchor')
def train_iterator_stage1(self, mi, fi, ml=None, fl=None):
# train Seger
for p in self.Seger.parameters(): # reset requires_grad
p.requires_grad = True # they are set to False below in netG update
for p in self.Reger.parameters(): # reset requires_grad -
p.requires_grad = False # they are set to False below in netG update
s_f = self.softmax(self.Seger(fi))
s_m = self.softmax(self.Seger(mi))
if ml is not None and fl is not None:
loss_anchor1 = self.L_seg(s_f, fl)
self.L_anchor_log.update(loss_anchor1.data, fi.shape[0])
loss_anchor2 = self.L_seg(s_m, ml)
self.L_anchor_log.update(loss_anchor2.data, fi.shape[0])
loss_seg = loss_anchor1 + loss_anchor2
loss_seg.backward()
self.optS.step()
self.Seger.zero_grad()
self.optS.zero_grad()
elif ml is not None and fl is None:
loss_anchor2 = self.L_seg(s_m, ml)
self.L_anchor_log.update(loss_anchor2.data, fi.shape[0])
loss_seg = loss_anchor2
loss_seg.backward()
self.optS.step()
self.Seger.zero_grad()
self.optS.zero_grad()
elif ml is None and fl is not None:
loss_anchor1 = self.L_seg(s_f, fl)
self.L_anchor_log.update(loss_anchor1.data, fi.shape[0])
loss_seg = loss_anchor1
loss_seg.backward()
self.optS.step()
self.Seger.zero_grad()
self.optS.zero_grad()
for p in self.Seger.parameters(): # reset requires_grad
p.requires_grad = False # they are set to False below in netG update
for p in self.Reger.parameters(): # reset requires_grad -
p.requires_grad = True # they are set to False below in netG update
s_f = s_f.detach()
s_m = s_m.detach()
s_f = torch.argmax(s_f, dim=1, keepdim=True)
s_f = [torch.where(s_f==i, torch.full_like(s_f, 1), torch.full_like(s_f, 0)) for i in range(self.n_classes)]
s_f = torch.cat(s_f, dim=1)
s_m = torch.argmax(s_m, dim=1, keepdim=True)
s_m = [torch.where(s_m == i, torch.full_like(s_m, 1), torch.full_like(s_m, 0)) for i in range(self.n_classes)]
s_m = torch.cat(s_m, dim=1)
r_fi = s_f * fi
r_fi = r_fi[:, 1:, :, :, :]
r_mi = s_m * mi
r_mi = r_mi[:, 1:, :, :, :]
# train Reger
w_m_to_f, w_f_to_m, w_label_m_to_f, w_label_f_to_m, flow = self.Reger(r_mi, r_fi, ml, fl)
loss_s = self.L_smooth(flow)
self.L_smooth_log.update(loss_s.data, mi.size(0))
loss_ncc = 0
for i in range(self.n_classes-1):
loss_ncc += self.L_ncc(w_m_to_f[:, i:i+1, :, :, :], r_fi[:, i:i+1, :, :, :])
self.L_ncc_log.update(loss_ncc.data, mi.size(0))
loss_Reg = loss_s + loss_ncc
loss_Reg.backward()
self.optR.step()
self.Reger.zero_grad()
self.optR.zero_grad()
def train_iterator_stage2(self, mi, fi, ml=None, fl=None):
for p in self.Seger.parameters(): # reset requires_grad
p.requires_grad = False # they are set to False below in netG update
for p in self.Reger.parameters(): # reset requires_grad -
p.requires_grad = True # they are set to False below in netG update
with torch.no_grad():
s_f = self.softmax(self.Seger(fi))
s_m = self.softmax(self.Seger(mi))
s_f = torch.argmax(s_f, dim=1, keepdim=True)
s_f = [torch.where(s_f == i, torch.full_like(s_f, 1), torch.full_like(s_f, 0)) for i in range(self.n_classes)]
s_f = torch.cat(s_f, dim=1)
s_m = torch.argmax(s_m, dim=1, keepdim=True)
s_m = [torch.where(s_m == i, torch.full_like(s_m, 1), torch.full_like(s_m, 0)) for i in range(self.n_classes)]
s_m = torch.cat(s_m, dim=1)
r_fi = s_f * fi
r_fi = r_fi[:, 1:, :, :, :]
r_mi = s_m * mi
r_mi = r_mi[:, 1:, :, :, :]
# train Reger
w_m_to_f, w_f_to_m, w_label_m_to_f, w_label_f_to_m, flow = self.Reger(r_mi, r_fi, ml, fl)
loss_s = self.L_smooth(flow)
self.L_smooth_log.update(loss_s.data, mi.size(0))
loss_ncc = 0
for i in range(self.n_classes - 1):
loss_ncc += self.L_ncc(w_m_to_f[:, i:i + 1, :, :, :], r_fi[:, i:i+1, :, :, :])
self.L_ncc_log.update(loss_ncc.data, mi.size(0))
loss_Reg = loss_s + loss_ncc
loss_Reg.backward()
self.optR.step()
self.Reger.zero_grad()
self.optR.zero_grad()
# RT
for p in self.Seger.parameters(): # reset requires_grad
p.requires_grad = True # they are set to False below in netG update
for p in self.Reger.parameters(): # reset requires_grad -
p.requires_grad = False # they are set to False below in netG update
flow = flow.detach()
if ml is not None and fl is None:
w_m_to_f = self.stn(mi, flow)
w_label_m_to_f = self.stn(ml, flow)
s_w_m_to_f = self.softmax(self.Seger(w_m_to_f))
s_f = self.softmax(self.Seger(fi))
loss_w = self.L_seg(s_f, w_label_m_to_f)
self.L_w_log.update(loss_w.data, fi.shape[0])
loss_anchor2 = self.L_seg(s_w_m_to_f, w_label_m_to_f)
self.L_anchor_log.update(loss_anchor2.data, fi.shape[0])
loss_seg = loss_anchor2 + 0.5*loss_w
loss_seg.backward()
self.optS.step()
self.Seger.zero_grad()
self.optS.zero_grad()
elif ml is None and fl is not None:
w_m_to_f = self.stn(mi, flow)
s_w_m_to_f = self.softmax(self.Seger(w_m_to_f))
s_f = self.softmax(self.Seger(fi))
loss_anchor1 = self.L_seg(s_f, fl)
self.L_anchor_log.update(loss_anchor1.data, fi.shape[0])
loss_w = self.L_seg(s_w_m_to_f, fl)
loss_seg = loss_anchor1 + 0.5*loss_w
loss_seg.backward()
self.optS.step()
self.Seger.zero_grad()
self.optS.zero_grad()
def train_epoch_stage1(self, epoch, is_aug=True):
self.Seger.train()
self.Reger.train()
for i in range(self.iters):
rad = np.random.randint(low=0, high=2)
if rad == 0:
dataloader = self.dataloader_labeled_unlabeled
else:
dataloader = self.dataloader_unlabeled_unlabeled
mov_img, fix_img, mov_lab, fix_lab = next(dataloader.__iter__())
if len(mov_lab.data.numpy().shape) == 1:
mov_lab = None
if len(fix_lab.data.numpy().shape) == 1:
fix_lab = None
if torch.cuda.is_available():
mov_img = mov_img.cuda()
fix_img = fix_img.cuda()
if mov_lab is not None:
mov_lab = mov_lab.cuda()
if fix_lab is not None:
fix_lab = fix_lab.cuda()
if is_aug:
code_mir = self.mirror_aug.rand_code()
code_spa = self.spatial_aug.rand_coords(mov_img.shape[2:])
mov_img = self.mirror_aug.augment_mirroring(mov_img, code_mir)
mov_img = self.spatial_aug.augment_spatial(mov_img, code_spa)
fix_img = self.mirror_aug.augment_mirroring(fix_img, code_mir)
fix_img = self.spatial_aug.augment_spatial(fix_img, code_spa)
if mov_lab is not None:
mov_lab = self.mirror_aug.augment_mirroring(mov_lab, code_mir)
mov_lab = self.spatial_aug.augment_spatial(mov_lab, code_spa, mode='nearest')
if fix_lab is not None:
fix_lab = self.mirror_aug.augment_mirroring(fix_lab, code_mir)
fix_lab = self.spatial_aug.augment_spatial(fix_lab, code_spa, mode='nearest')
self.train_iterator_stage1(mov_img, fix_img, mov_lab, fix_lab)
res = '\t'.join(['Epoch: [%d/%d]' % (epoch + 1, self.epoches),
'Iter: [%d/%d]' % (i + 1, self.iters),
self.L_smooth_log.__str__(),
self.L_ncc_log.__str__(),
self.L_anchor_log.__str__()])
print("Stage 1:", res)
def train_epoch_stage2(self, epoch, is_aug=True):
self.Seger.train()
self.Reger.train()
for i in range(self.iters):
rad = np.random.randint(low=0, high=2)
if rad == 0:
dataloader = self.dataloader_labeled_unlabeled
else:
dataloader = self.dataloader_unlabeled_unlabeled
mov_img, fix_img, mov_lab, fix_lab = next(dataloader.__iter__())
if len(mov_lab.data.numpy().shape) == 1:
mov_lab = None
if len(fix_lab.data.numpy().shape) == 1:
fix_lab = None
if torch.cuda.is_available():
mov_img = mov_img.cuda()
fix_img = fix_img.cuda()
if mov_lab is not None:
mov_lab = mov_lab.cuda()
if fix_lab is not None:
fix_lab = fix_lab.cuda()
if is_aug:
code_mir = self.mirror_aug.rand_code()
code_spa = self.spatial_aug.rand_coords(mov_img.shape[2:])
mov_img = self.mirror_aug.augment_mirroring(mov_img, code_mir)
mov_img = self.spatial_aug.augment_spatial(mov_img, code_spa)
fix_img = self.mirror_aug.augment_mirroring(fix_img, code_mir)
fix_img = self.spatial_aug.augment_spatial(fix_img, code_spa)
if mov_lab is not None:
mov_lab = self.mirror_aug.augment_mirroring(mov_lab, code_mir)
mov_lab = self.spatial_aug.augment_spatial(mov_lab, code_spa, mode='nearest')
if fix_lab is not None:
fix_lab = self.mirror_aug.augment_mirroring(fix_lab, code_mir)
fix_lab = self.spatial_aug.augment_spatial(fix_lab, code_spa, mode='nearest')
self.train_iterator_stage2(mov_img, fix_img, mov_lab, fix_lab)
res = '\t'.join(['Epoch: [%d/%d]' % (epoch + 1, self.epoches),
'Iter: [%d/%d]' % (i + 1, self.iters),
self.L_smooth_log.__str__(),
self.L_ncc_log.__str__(),
self.L_w_log.__str__(),
self.L_anchor_log.__str__()])
print("Stage 2:", res)
def test_iterator(self, mi, fi, ml=None, fl=None):
with torch.no_grad():
# Seg
s_m = self.softmax(self.Seger(mi))
s_f = self.softmax(self.Seger(fi))
# Reg
r_fi = s_f * fi
r_fi = r_fi[:, 1:, :, :, :]
r_mi = s_m * mi
r_mi = r_mi[:, 1:, :, :, :]
w_m_to_f, w_f_to_m, w_label_m_to_f, w_label_f_to_m, flow = self.Reger(r_mi, r_fi, ml, fl)
w_m_to_f = self.stn(mi, flow)
w_label_m_to_f = self.stn(ml, flow)
return w_m_to_f, w_label_m_to_f, s_m, s_f, flow
def test(self):
self.Seger.eval()
self.Reger.eval()
for i, (mi, fi, ml, fl, name) in enumerate(self.dataloader_labeled_labeled):
name = name[0]
if torch.cuda.is_available():
mi = mi.cuda()
fi = fi.cuda()
ml = ml.cuda()
fl = fl.cuda()
w_m_to_f, w_label_m_to_f, s_m, s_f, flow = self.test_iterator(mi, fi, ml, fl)
mi = mi.data.cpu().numpy()[0, 0]
fi = fi.data.cpu().numpy()[0, 0]
ml = np.argmax(ml.data.cpu().numpy()[0], axis=0)
fl = np.argmax(fl.data.cpu().numpy()[0], axis=0)
flow = flow.data.cpu().numpy()[0]
w_m_to_f = w_m_to_f.data.cpu().numpy()[0, 0]
w_label_m_to_f = np.argmax(w_label_m_to_f.data.cpu().numpy()[0], axis=0)
s_m = np.argmax(s_m.data.cpu().numpy()[0], axis=0)
s_f = np.argmax(s_f.data.cpu().numpy()[0], axis=0)
mi = mi.astype(np.float32)
fi = fi.astype(np.float32)
ml = ml.astype(np.float32)
fl = fl.astype(np.float32)
w_m_to_f = w_m_to_f.astype(np.float32)
w_label_m_to_f = w_label_m_to_f.astype(np.float32)
s_m = s_m.astype(np.float32)
s_f = s_f.astype(np.float32)
flow = flow.astype(np.float32)
if not os.path.exists(join(self.results_dir, self.model_name, 'mi')):
os.makedirs(join(self.results_dir, self.model_name, 'mi'))
if not os.path.exists(join(self.results_dir, self.model_name, 'fi')):
os.makedirs(join(self.results_dir, self.model_name, 'fi'))
if not os.path.exists(join(self.results_dir, self.model_name, 'ml')):
os.makedirs(join(self.results_dir, self.model_name, 'ml'))
if not os.path.exists(join(self.results_dir, self.model_name, 'fl')):
os.makedirs(join(self.results_dir, self.model_name, 'fl'))
if not os.path.exists(join(self.results_dir, self.model_name, 'flow')):
os.makedirs(join(self.results_dir, self.model_name, 'flow'))
if not os.path.exists(join(self.results_dir, self.model_name, 'w_m_to_f')):
os.makedirs(join(self.results_dir, self.model_name, 'w_m_to_f'))
if not os.path.exists(join(self.results_dir, self.model_name, 'w_label_m_to_f')):
os.makedirs(join(self.results_dir, self.model_name, 'w_label_m_to_f'))
if not os.path.exists(join(self.results_dir, self.model_name, 's_m')):
os.makedirs(join(self.results_dir, self.model_name, 's_m'))
if not os.path.exists(join(self.results_dir, self.model_name, 's_f')):
os.makedirs(join(self.results_dir, self.model_name, 's_f'))
mi.tofile(join(self.results_dir, self.model_name, 'mi', name[:-4]+'.raw'))
fi.tofile(join(self.results_dir, self.model_name, 'fi', name[:-4]+'.raw'))
ml.tofile(join(self.results_dir, self.model_name, 'ml', name[:-4]+'.raw'))
fl.tofile(join(self.results_dir, self.model_name, 'fl', name[:-4]+'.raw'))
w_m_to_f.tofile(join(self.results_dir, self.model_name, 'w_m_to_f', name[:-4]+'.raw'))
w_label_m_to_f.tofile(join(self.results_dir, self.model_name, 'w_label_m_to_f', name[:-4]+'.raw'))
s_m.tofile(join(self.results_dir, self.model_name, 's_m', name[:-4]+'.raw'))
s_f.tofile(join(self.results_dir, self.model_name, 's_f', name[:-4]+'.raw'))
flow.tofile(join(self.results_dir, self.model_name, 'flow', name[:-4]+'.raw'))
print(name)
def evaluate(self):
DSC_R = np.zeros((self.n_classes, self.dataloader_labeled_labeled.__len__()))
DSC_S = np.zeros((self.n_classes, self.dataloader_labeled_labeled.__len__()))
image_filenames = listdir(join(self.results_dir, self.model_name, 's_f'))
for i in range(len(image_filenames)):
name = image_filenames[i]
w_label_m_to_f = np.fromfile(join(self.results_dir, self.model_name, 'w_label_m_to_f', name), dtype=np.float32)
w_label_m_to_f = to_categorical(w_label_m_to_f, self.n_classes)
fl = np.fromfile(join(self.results_dir, self.model_name, 'fl', name), dtype=np.float32)
fl = to_categorical(fl, self.n_classes)
ml = np.fromfile(join(self.results_dir, self.model_name, 'ml', name), dtype=np.float32)
ml = to_categorical(ml, self.n_classes)
s_m = np.fromfile(join(self.results_dir, self.model_name, 's_m', name), dtype=np.float32)
s_m = to_categorical(s_m, self.n_classes)
for c in range(self.n_classes):
DSC_R[c, i] = dice(w_label_m_to_f[c], fl[c])
DSC_S[c, i] = dice(s_m[c], ml[c])
print(name, DSC_S[1:, i], DSC_R[1:, i])
print(np.mean(DSC_S[1:, :], axis=1), np.mean(DSC_R[1:, :], axis=1))
# print(np.mean(DSC_S[1:, :]), np.mean(DSC_R[1:, :]))
print(np.mean(DSC_S[1:, :]), np.std(np.mean(DSC_S[1:, :], axis=0)))
print(np.mean(DSC_R[1:, :]), np.std(np.mean(DSC_R[1:, :], axis=0)))
def checkpoint(self, epoch, k, stage='Stage1'):
torch.save(self.Seger.state_dict(),
'{0}/{1}_epoch_{2}.pth'.format(self.checkpoint_dir, stage+'_Seger_'+self.model_name, epoch+k),
_use_new_zipfile_serialization=False)
torch.save(self.Reger.state_dict(),
'{0}/{1}_epoch_{2}.pth'.format(self.checkpoint_dir, stage+'_Reger_'+self.model_name, epoch+k),
_use_new_zipfile_serialization=False)
def load(self, stage='Stage2'):
self.Reger.load_state_dict(
torch.load('{0}/{1}_epoch_{2}.pth'.format(self.checkpoint_dir, stage+'_Reger_'+self.model_name, str(self.k))))
self.Seger.load_state_dict(
torch.load('{0}/{1}_epoch_{2}.pth'.format(self.checkpoint_dir, stage+'_Seger_' + self.model_name, str(self.k))))
def train(self, stage1=True, stage2=True):
if stage1:
for epoch in range(self.epoches-self.k):
self.L_smooth_log.reset()
self.L_ncc_log.reset()
self.L_w_log.reset()
self.L_anchor_log.reset()
self.train_epoch_stage1(epoch+self.k)
if epoch % 20 == 0:
self.checkpoint(epoch, self.k, stage='Stage1')
self.checkpoint(self.epoches-self.k, self.k, stage='Stage1')
if stage2:
for epoch in range(self.epoches - self.k):
self.L_smooth_log.reset()
self.L_ncc_log.reset()
self.L_w_log.reset()
self.L_anchor_log.reset()
self.train_epoch_stage2(epoch + self.k)
if epoch % 20 == 0:
self.checkpoint(epoch, self.k, stage='Stage2')
self.checkpoint(self.epoches-self.k, self.k, stage='Stage2')
if __name__ == '__main__':
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
RSTNet = RSeg()
# RSTNet.load(stage='Stage2')
RSTNet.train(stage1=True, stage2=True)
RSTNet.test()
RSTNet.evaluate()
# export CUDA_VISIBLE_DEVICES=2
# nohup python semi_pcreg.py > run_pcreg_cross455.log 2>&1 &