Skip to content

Commit fc34ddc

Browse files
committed
fix bug
1 parent ac0fbba commit fc34ddc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

python/paddle/fluid/dataloader/dataloader_iter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def _init_thread(self):
303303
self._thread.daemon = True
304304
self._thread.start()
305305

306-
def _thread_loop(self, legacy_expected_place=None):
306+
def _thread_loop(self, legacy_expected_place):
307307
try:
308308
#NOTE(zhiqiu): Set the expected place for new thread as the same as father thread,
309309
# and it will call platform::SetDeviceId() in c++ internally.
@@ -613,7 +613,7 @@ def _exit_thread_unexpectedly(self):
613613
self._blocking_queue.kill()
614614
logging.error("DataLoader reader thread raised an exception!")
615615

616-
def _thread_loop(self, legacy_expected_place=None):
616+
def _thread_loop(self, legacy_expected_place):
617617
#NOTE(zhiqiu): Set the expected place for new thread as the same as father thread,
618618
# and it will call platform::SetDeviceId() in c++ internally.
619619
# If we do not set cudaDeviceId in new thread, the default cudaDeviceId will be 0,

python/paddle/fluid/reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ def _exit_thread_unexpectedly(self):
971971
self._blocking_queue.kill()
972972
logging.error("DataLoader reader thread raised an exception!")
973973

974-
def _reader_thread_loop_for_multiprocess(self):
974+
def _reader_thread_loop_for_multiprocess(self, legacy_expected_place):
975975
# See _DataLoaderIterSingleProcess._thread_loop() for why set expected place here.
976976
_set_expected_place(legacy_expected_place)
977977

@@ -1013,7 +1013,7 @@ def _reader_thread_loop_for_multiprocess(self):
10131013
else:
10141014
self._exit_thread_expectedly()
10151015

1016-
def _reader_thread_loop_for_singleprocess(self):
1016+
def _reader_thread_loop_for_singleprocess(self, legacy_expected_place):
10171017
try:
10181018
# See _DataLoaderIterSingleProcess._thread_loop() for why set expected place here.
10191019
_set_expected_place(legacy_expected_place)

0 commit comments

Comments
 (0)