Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move examples to fn api #2566

Merged
merged 5 commits into from
Jan 10, 2021
Merged

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Dec 18, 2020

  • move all use cases to the functional API
  • reworks SSD, RN50, super resolution and TSM examples

Signed-off-by: Janusz Lisiecki [email protected]

Why we need this PR?

Pick one, remove the rest

  • It moves network examples to the functional API

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    reworks SSD, RN50, super resolution and TSM examples to use the functional API
  • Affected modules and functionalities:
    use_cases part of the documentation
  • Key points relevant for the review:
    functional API usage
  • Validation and testing:
    CI
  • Documentation (including examples):
    documentation and examples have been updated

JIRA TASK: [NA]

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jantonguirao jantonguirao self-assigned this Jan 4, 2021
@@ -202,14 +166,32 @@ def main():
FLAGS.device_id = int(env['FLAGS_selected_gpus'])
FLAGS.whole_batch_size = FLAGS.world_size * FLAGS.batch_size

pipe = HybridTrainPipe()
pipe = create_dali_pipeline(batch_size=FLAGS.batch_size,
num_threads=FLAGS.num_threads,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: indent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

train_loader = DALIClassificationIterator(pipe, reader_name="Reader",
last_batch_policy=LastBatchPolicy.PARTIAL)

if FLAGS.local_rank == 0:
pipe = HybridValPipe()
pipe = create_dali_pipeline(batch_size=FLAGS.batch_size,
num_threads=FLAGS.num_threads,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: indent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

scaling=[0.3, 1.0],
bbox_layout="xyXY",
allow_no_crop=True,
num_attempts=1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you changed from 50 attempts to 1. Why is that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste. Done

allow_no_crop=True,
num_attempts=1)
images = fn.image_decoder_slice(
images, crop_begin, crop_size, device="cpu", output_type=types.RGB)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before there was device='mixed'. Did you change it in purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

0.3, 1.0],
bbox_layout="xyXY",
allow_no_crop=True,
num_attempts=1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the number of attempts being 1 was intentional in the first place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste. Done

crop_pos_x=fn.uniform(range=(0.0, 1.0)),
crop_pos_y=fn.uniform(range=(0.0, 1.0)))

images = fn.tanspose(images, perm=[3, 0, 1, 2])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
images = fn.tanspose(images, perm=[3, 0, 1, 2])
images = fn.transpose(images, perm=[3, 0, 1, 2])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@JanuszL JanuszL force-pushed the move_examples_to_fn_api branch 2 times, most recently from 6c138b8 to 6426f2d Compare January 7, 2021 22:42
@JanuszL
Copy link
Contributor Author

JanuszL commented Jan 8, 2021

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1964638]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1964638]: BUILD PASSED

@JanuszL
Copy link
Contributor Author

JanuszL commented Jan 8, 2021

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1965358]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1965358]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1966526]: BUILD FAILED

- move all use cases to the functional API
- reworks SSD, RN50, super resolution and TSM examples

Signed-off-by: Janusz Lisiecki <[email protected]>
Signed-off-by: Janusz Lisiecki <[email protected]>
Signed-off-by: Janusz Lisiecki <[email protected]>
Signed-off-by: Janusz Lisiecki <[email protected]>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1966933]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1966933]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1966996]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1966996]: BUILD FAILED

Signed-off-by: Janusz Lisiecki <[email protected]>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1967684]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1967762]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1967684]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1967762]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1967684]: BUILD PASSED

@JanuszL JanuszL merged commit b544dd4 into NVIDIA:master Jan 10, 2021
@JanuszL JanuszL deleted the move_examples_to_fn_api branch January 10, 2021 11:19
@JanuszL JanuszL mentioned this pull request May 19, 2021
@JanuszL JanuszL mentioned this pull request Oct 26, 2021
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants