NVIDIA/DALI

numpy reader error

Open

#3,714 opened on Mar 2, 2022

View on GitHub
 (1 comment) (0 reactions) (1 assignee)C++ (670 forks)auto 404
help wanted

Repository metrics

Stars
 (5,722 stars)
PR merge metrics
 (PR metrics pending)

Description

The following error occurred while loading data to gpu using numpy reader.

Below is the source code and the printed error message.

from nvidia.dali import pipeline_def, fn data_dir = os.path.join(data_dir_2d, 'SER00001') @pipeline_def(batch_size=batch_size, num_threads=1, device_id=0) def pipe_gds(): data = fn.readers.numpy(device='gpu', file_root=data_dir, file_filter='*.npy') return data p = pipe_gds()
p.build() pipe_out = p.run()
data_gds = pipe_out[0].as_cpu().as_array() # as_cpu() to c|opy the data back to CPU memory print(data_gds.shape)

RuntimeError: [/opt/dali/dali/python/backend_impl.cc:752] Assert on "tl.IsDenseTensor()" failed: Tensors in the list must have the same shape

Contributor guide