Skip to content

Commit c12afff

Browse files
committed
Fix the problem of dataloader crash at the end of training
1 parent e33b21f commit c12afff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dygraph/paddleseg/core/train.py

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import os
16+
import time
1617

1718
import paddle
1819
import paddle.nn.functional as F
@@ -181,5 +182,8 @@ def train(model,
181182
log_writer.add_scalar('Evaluate/Acc', acc, iter)
182183
model.train()
183184
timer.restart()
185+
186+
# Sleep for half a second to let dataloader release resources.
187+
time.sleep(0.5)
184188
if use_vdl:
185189
log_writer.close()

0 commit comments

Comments
 (0)