Comments (4)
Hi @wangdada-love,
Thank you for reaching out. If you want to add images with weights please just:
imge3 = img1 * weight1 + img2 * weight2
from dali.
Thanks for your reply.
I have tried this method before, But I received an error message as follows:
RuntimeError: Critical error in pipeline:
Error when executing GPU operator conditional__Merge, instance name: "__Merge_29", encountered:
[/opt/dali/dali/pipeline/operator/builtin/conditional/merge.cc:45] Assert on "base_input.type() == input.type()" failed: Divergent data found in different branches of conditional operation. All paths in conditional operation are merged into one batch which must have consistent type, number of dimensions, layout and other metadata. Found distinct types: float and uint8.
I just tried again, but got the same error message. Based on the error message, I speculate that the problem is caused by an incorrect data type. So, I made the following modifications to the code:
def rand_sharp(images, scale=1.0, window_size=3, device="gpu"):
sharp = fn.laplacian(images, scale=scale, window_size=window_size, device=device)
sharp = fn.cast(sharp, dtype=dali.types.DALIDataType.FLOAT)
images = fn.cast(images, dtype=dali.types.DALIDataType.FLOAT)
out = 0.7 * images + 0.3 * sharp
out = fn.cast(out, dtype=dali.types.DALIDataType.UINT8)
return out
it works.
from dali.
Hi @wangdada-love,
I'm happy you made that work. The issue is that out = 0.7 * images + 0.3 * sharp
returns float type while the other branch of your if
condition returns just int8, so in your context just
def rand_sharp(images, scale=1.0, window_size=3, device="gpu"):
sharp = fn.laplacian(images, scale=scale, window_size=window_size, device=device)
out = 0.7 * images + 0.3 * sharp
out = fn.cast(out, dtype=dali.types.DALIDataType.UINT8)
return out
should do as well.
from dali.
outstanding! thank you very much.
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
- Get audio data from external data sources and start iteration HOT 7
- 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.