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

Trained Weights Source #3

Closed
AshwinKumarVijay opened this issue May 10, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@AshwinKumarVijay
Copy link

commented May 10, 2019

Hey!

I'm pretty interested in this project, and I'm curious as to what the format for the weights of your trained model are. I have a couple of ONNX models that I wanted to use in with this, and I wanted to know how to load them.

Thanks!

@PatriceVignola

This comment has been minimized.

Copy link

commented May 15, 2019

Hi!

DirectML is a low-level API designed for control and doesn't support loading ONNX models directly. If you want to use DirectML with ONNX models, you should try using Windows ML. When you create a GPU device with Windows ML, DirectML will be used under the hood to run your ONNX model. You can give a look at their samples to get started.

@AshwinKumarVijay

This comment has been minimized.

Copy link
Author

commented May 15, 2019

Thanks for your reply!

Actually, I'm interested in using DirectML with D3D12, similar to the SR example that you have. I wanted to know how you created your model, or what the format is and how I can create models that work with DirectML.

@PatriceVignola

This comment has been minimized.

Copy link

commented May 18, 2019

DirectML doesn't have the concept of a "model". For example, if you already have a trained ONNX model, you would need to "translate" it to DirectML at compile time by calling IDMLDevice::CreateOperator() with the appropriate DML_OPERATOR_DESC struct for every operator in the model. This is what the SR sample is doing. You would also need to extract the weights from the model and store them in a format that can be read by DirectML. For instance, the SR sample simply stores the weights in a binary file that can be parsed as raw bytes at runtime.

Does that answer your question?

@AshwinKumarVijay

This comment has been minimized.

Copy link
Author

commented May 20, 2019

Yes! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.