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

Update ExternalSource framework examples #2482

Merged
merged 4 commits into from
Nov 19, 2020
Merged

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Nov 18, 2020

  • use functional API
  • use modern external source (with source arg)
  • use more efficient way of reading files
  • showcase direct usage of PyTorch and MXNet tensors
  • use multi-output external source

Signed-off-by: Michał Zientkiewicz mzient@gmail.com

Why we need this PR?

Pick one, remove the rest

  • It uses up-to-date techniques in PyTorch/ExternalSource example
  • It fixes a build issue with clang 6

What happened in this PR?

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

  • What solution was applied:
    • use functional API
    • use modern external source (with source arg)
    • use more efficient way of reading files
    • showcase direct usage of PyTorch tensors
    • use multi-output external source
  • Affected modules and functionalities:
    • ExternalSource examples in PyTorch, MXNet and PaddlePaddle
  • Key points relevant for the review:
    • N/A
  • Validation and testing:
    • N/A
  • Documentation (including examples):
    • It's the documentation

JIRA TASK: N/A

@mzient mzient requested a review from a team November 18, 2020 19:55
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@mzient
Copy link
Contributor Author

mzient commented Nov 18, 2020

!build

@@ -24,8 +24,9 @@
"import numpy as np\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can jus remove size or set it to -1 so StopIteration will just stop the PyTorchIterator.


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I removed size the iterator ran indefinitely in epoch 0.

Copy link
Contributor

Choose a reason for hiding this comment

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

mhhh, strange

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1811756]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1811756]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1811756]: BUILD PASSED

mzient and others added 3 commits November 19, 2020 12:28
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
* use functional API
* use modern external source (with source arg)
* use more efficient way of reading files
* showcase direct usage of PyTorch tensors
* use multi-output external source

Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@mzient mzient changed the title Update PyTorch ExternalSource example Update ExternalSource framework examples Nov 19, 2020
Comment on lines +439 to +440
template class DLL_PUBLIC TensorVector<CPUBackend>;
template class DLL_PUBLIC TensorVector<GPUBackend>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without it debug build with Clang 6 didn't link properly.

@mzient
Copy link
Contributor Author

mzient commented Nov 19, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1814371]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1814371]: BUILD PASSED

@@ -15,7 +15,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@mzient mzient merged commit c49ea76 into NVIDIA:master Nov 19, 2020
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.

None yet

5 participants