Comments (7)
Maybe the parameter should work the other way round, because actually your PR is a breaking change, if someone relies on the fact that the input variable is indeed standardized. I assume this is a very edgy case, however, I can think of it.
from keras-preprocessing.
It is as designed, mostly to reuse memory when possible. When using jupyter, I would suggest providing a copy of the input instead.
from keras-preprocessing.
In this case I agree with @alxy. This is a bad practice and should be avoided, as it is an unexpected behavior that faces the user and can have unexpected consequences down the pipeline, which normally turns out to be a nightmare to debug. Since Keras puts the user first this should be avoided on any function facing the user directly. The behavior of course reduces the memory footprint and can bring benefits, but it should only be used on internal logic not on top-level user facing functions.
That's why for example we do this: https://github.com/keras-team/keras-preprocessing/blob/master/keras_preprocessing/image/dataframe_iterator.py#L106 even though this holds two copies of the dataframe at some point in time, but the user is first so we do it.
@Dref360 I made a PR #138 to address this issue. If there are more places where this happens it should be addressed as well.
from keras-preprocessing.
Modify in place wouldn't be bad if you wouldn't return a value.
If the user wishes to save memory, passing an extra param (in_place for example) is better suited.
from keras-preprocessing.
@Dref360 should we merge the related PR and close this issue? then we can discuss the introduction of an inplace argument or so. I need a review on the PR though before I can merge.
from keras-preprocessing.
Good point, specially because it is used internally by the ImageDataGenerator
in this way. I'll update the PR, thanks for the feedback.
from keras-preprocessing.
I believe this can be closed.
from keras-preprocessing.
Related Issues (20)
- ImageDataGenerator preparing labels to semantic segmentation HOT 1
- apply_affine_transform() confuses between X and Y HOT 1
- apply_affine_transform() callers do not pass axes indices (row_axis, col_axis)
- Does one really need row_axis/col_axis arguments in image transform functions?
- Get rid of scipy HOT 12
- Bug: axes transformation is incomplete
- Missing scale parameter in apply_brightness_shift() call HOT 1
- Q: how to turn off automatic data augmentation of ImageDataGenerator?
- apply_affine_transform calls tensor.ndim
- How to make keras ImageGenerator load float32 images HOT 1
- ImageDataGenerator, Apply augmentation on images that have more than 4 channels HOT 3
- Image data flows modify Numpy's global RNG
- Color conversion
- Pillow 8.3.0 breaks image.img_to_array() HOT 1
- char-level Tokenizer.sequences_to_texts() insert additional SPACEs
- Variable target_size on flow_from_dataframe()
- affine_transformations.py random_shift function tx ty? HOT 1
- ImageDataGenerator should be able to write per label
- skip-grams negative sample should not sample from whole vacabs HOT 1
- skipgrams negative sample should only sample from out of window words 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 keras-preprocessing.