remove numpy array check in single-process dataloader. test=develop (#30861)

revert-31068-fix_conv3d_windows
Kaipeng Deng 5 years ago committed by GitHub
parent b7560a59ab
commit 302427170f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -320,7 +320,6 @@ class _DataLoaderIterSingleProcess(_DataLoaderIterBase):
array = core.LoDTensorArray()
for slot in batch:
if not isinstance(slot, core.LoDTensor):
self._check_input_array(slot)
# FIXME(dkp): blocking_queue only support
# core.LoDTensorArray as input now, read
# numpy data into a LoDTensorArray here,
@ -346,19 +345,6 @@ class _DataLoaderIterSingleProcess(_DataLoaderIterBase):
logging.warning("DataLoader reader thread raised an exception.")
six.reraise(*sys.exc_info())
@classmethod
def _check_input_array(cls, item):
if isinstance(item, paddle.Tensor):
return
arr = np.array(item)
if arr.dtype == np.object:
raise TypeError((
"\n\tFaild to convert input data to a regular ndarray :\n\t* Usually "
"this means the input data contains nested lists with different lengths. "
"\n\t* Check the reader function passed to 'decorate_batch_generator'"
" to locate the data causes this issue.\n\t* Please consider using "
"'fluid.create_lod_tensor' to convert it to a LoD-Tensor."))
def __next__(self):
try:
if in_dygraph_mode():

Loading…
Cancel
Save