Comments (2)
Hi, have you actually tried this and noticed a performance difference? If so, feel free to propose a PR with some information on what speed-up this gives on your system.
from cam2bev.
I have tried to swap the order of the pipeline calls, i.e. batch first and then map, by adjusting the mapped parse_sample
function like so:
# build dataset pipeline parsing functions
def parse_sample(batched_input_files, batched_label_file):
# parse and process input images
# define unbatched parsing operations
def parse_input(i):
i = utils.load_image_op(i)
i = utils.resize_image_op(i, image_shape_original_input, conf.image_shape, interpolation=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
i = utils.one_hot_encode_image_op(i, conf.one_hot_palette_input)
return i
def parse_label(l):
l = utils.load_image_op(l)
l = utils.resize_image_op(l, image_shape_original_label, conf.image_shape, interpolation=tf.image.ResizeMethod.NEAREST_NEIGHBOR)
l = utils.one_hot_encode_image_op(l, conf.one_hot_palette_label)
return l
# parse and process input images
inputs = []
for inp in batched_input_files:
inputs.append(tf.map_fn(parse_input, inp, fn_output_signature=tf.float32))
inputs = inputs[0] if n_inputs == 1 else tuple(inputs)
# parse and process label image
label = tf.map_fn(parse_label, batched_label_file, fn_output_signature=tf.float32)
return inputs, label
I did not find a way to vectorize the parsing across the entire batch. Vectorization is why the linked TensorFlow doc recommends batch first, then map. Without vectorization, this version actually had a worse runtime than before. My runtimes are included for reference:
config.1_FRLR.unetxst.yml
max-samples-training: 1000
max-samples-validation: 100
epochs: 20
save_interval: 10
- GPU: RTX 3090
- before: 16m 40s
- after: 18m 30s
@bastilam: I propose to close the issue. MRs with documented runtime improvements are still happily accepted.
from cam2bev.
Related Issues (20)
- how to generate this simulated data
- Frame Rate HOT 4
- Training of deeplab-mobilenet and deeplab-xception failed HOT 2
- What changes to make to resume training from where it was left off? HOT 2
- Non-360 View HOT 10
- Frame rate HOT 2
- Training on original input HOT 2
- How to test on real-world images HOT 1
- Performance when evaluating custom data HOT 1
- BEV image HOT 8
- some issue about "homography_converter" HOT 10
- What should the regularization coefficient be set to? HOT 1
- drone camera config file HOT 2
- A few questions about your work HOT 1
- 0
- Training on Google Colab HOT 2
- Real-world application HOT 1
- field of view single-input model HOT 2
- the R matrix calculate order may have some problem? HOT 1
- Model for testing 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 cam2bev.