Comments (7)
Thank you very much for your response. I have successfully resolved my issue. I will close this matter now and once again thank you for your advice.
from dali.
Hi @Tpcsy,
Thank you for reaching out.
Can you try:
b=np.frombuffer(f.read(), dtype=np.uint8)
# print(b)
batch.append(b)
return [batch]
As the documentation states:
Depending on the value of num_outputs, the source can supply one or more data items. The data item can be a whole batch (default) or a single batch entry (when batch==False). If num_outputs is not set, the source is expected to return one item (a batch or a sample). If this value is specified (even if its value is 1), the data is expected to a be tuple, or list, where each element corresponds to respective return value of the external_source.
from dali.
from dali.
Hi @JanuszL
Thank you very much for your reply.
I tried the changes you suggested, and it resulted in the following error:
RuntimeError: [/opt/dali/dali/pipeline/data/tensor_list.cc:1012] Assert on "IsDenseTensor()" failed: The batch must be representable as a tensor - it must have uniform shape and be allocated in contiguous memory.
I'm not sure if this is related to the different sizes of my audio files.
from dali.
Hi @Tpcsy,
I'm not sure if this is related to the different sizes of my audio files.
DALI expects (similarly to Torch data processing) samples to have uniform shapes in the batch. What you can do is to either trim/pad them or use 'DALIRaggedIterator' that will allow you to return nonuniform batch as a set of Torch tensors.
from dali.
Thank you very much for your suggestion. I tried the DALIRaggedIterator as you mentioned and successfully retrieved a batch of data. Now, I want to perform cropping operations on my tensors in the pipeline. Due to the nature of my task, each audio clip needs a different cropping position, and I need to return string-type data from an external source to guide the cropping operation on my audio tensors. However, I couldn't find a method in the pipeline that can accept and use string data. Can you please advise me on how to proceed? Thanks again for your help.
from dali.
I need to return string-type data from an external source to guide the cropping operation on my audio tensors
I'm not sure if I understand your idea correctly.
What you should do is to return the start and size of the cropping window and use the slice
operator.
from dali.
Related Issues (20)
- Segmentation fault when using 'mixed' HOT 5
- Bbox Pruning Too Aggressive? HOT 5
- Indexing video with binary mask HOT 1
- source_info tensor not guaranteed to contain correct data HOT 1
- 16 bit gray scale Image read error HOT 1
- COCO Reader pixelwise_masks Emtpy Output HOT 7
- Dali on Jetson: nvidia.dali.fn.readers.video_resize is missing HOT 4
- Numpy reader test (GDS) HOT 4
- How to add a scalar value to the loader? HOT 1
- Can DALI be integrated into HuggingFace Trainer? HOT 9
- Bug in creating `TensorGPU` when `stream` key is `None` in CUDA array interface HOT 2
- Configure max image size HOT 3
- Webdataset reader behavior with many sources HOT 1
- ModuleNotFoundError: No module named 'nvidia.dali.python_function_plugin' HOT 3
- Speed up Dino with DALI HOT 3
- error using webdataset
- webdataset cannot stop cycling at end of epoch HOT 11
- Encountered some issues when using mirror flip HOT 2
- Can AArch64 Numba tests be re-renabled? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dali.