Comments (5)
Hi @SunXuan90,
Thank you for reporting this bug. There are two problems with your code. The first one is an actual bug in the lookup table operator (we will fix it soon), and the second one is an issue with your code snippet. Let me explain.
external_source source
argument is meant for a callable or an iterable. In your case, you are feeding an iterable that it is interpreted as batches of data. The outermost dimension is interpreted as the number of batches (1 batch in your example) and the innermost dimension is interpreted as batch size (4 in your example). Since there are no more dimensions, each sample is assumed to be a scalar value (0-D). That is, you are processing a batch of 4 scalars. The bug in the GPU operator is when processing scalars (fix coming soon).
Now, I believe that your intention (correct me if I am wrong) was to apply a lookup table to a 2-dimensional matrix. Let me give you a couple of examples that do that:
First, using a 2D constant array, no need for external source:
scale_mat = fn.lookup_table(
np.array([[0, 1, 2, 3]]),
keys=scale_keys,
values=scale_values,
device=device,
dtype=types.INT64,
)
Second, using a callable to generate batches of random data:
def get_mat():
out = [
(np.random.randint(0, 4, size=(1, 4), dtype=np.int32))
for _ in range(batch_size)
]
return out
ids = fn.external_source(source=get_mat, device=device)
scale_mat = fn.lookup_table(
ids,
keys=scale_keys,
values=scale_values,
device=device,
dtype=types.INT64,
)
The good news is that processing 2D inputs should work, as the bug only applies to scalar inputs.
For the record, I'll let you know here when the fix is merged to the main branch.
from dali.
Hi @SunXuan90,
I can confirm there is a problem with the GPU variant of that operator. Let us investigate it and get back to you with more info soon.
from dali.
Thank you!
from dali.
The fix has been merged. It should be available in the next nightly build and 1.34 release.
from dali.
1.34 is out.
from dali.
Related Issues (20)
- Can I use DALI only for data augmentation? HOT 2
- Checkpoint support for readers HOT 7
- How to use Dali tool for image sharpening operation HOT 4
- Ran of GPU memory when using Imagenet but not COCO-Stuff 2017 HOT 20
- how to do a image zoom? HOT 9
- Unrecognized image format HOT 1
- Inference Model without converting TensorGPU to TensorCPU HOT 2
- Stack a batch in one batch of this shape HOT 4
- How to get center crop HOT 6
- GitHub Roadmap 2024 HOT 4
- Why is the val_loss curve trained through Dali data loading method oscillating? HOT 2
- NumPy decoder HOT 8
- Using JPEG hardware decoder with DALI on A100 GPU
- Extracting properties from a list of DataNodes HOT 5
- A100 hardware decoder HOT 1
- Extract motion vectors HOT 7
- 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
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.