-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Any way to load or convert a .pth? #1789
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
Comments
You might be able to convert your pytorch model to ONNX and then to Barracuda: It looks like the Barracuda converter is still a work in progress and only supports some layers/nodes. EDIT It looks like the script "onnx_to_barracuda.py" mentioned in that readme has not been written yet. Sorry for the confusion. |
Thanks, I'll check it out
…On Tue, 5 Mar 2019, 18:35 sam598, ***@***.***> wrote:
You might be able to convert your pytorch model to ONNX and then to
Barracuda:
https://github.com/Unity-Technologies/ml-agents/blob/master/UnitySDK/Assets/ML-Agents/Plugins/Barracuda.Core/Barracuda.md
It looks like the Barracuda converter is still a work in progress and only
supports some layers/nodes.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1789 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEW2W5gbknH22sF0cDeUGI-2vedHO5heks5vTqrKgaJpZM4beaiG>
.
|
Ok no worries, I found this script tensorflow_to_barracuda.py, I'll try to use mmdnn to convert .pth to tensorflow then run that script. Fwiw I think the md linked is out of date, the .bytes format has been dropped afaict |
Hi @bassmit! |
Hi Mantas, I tried getting to a tensorflow model through ONNX, but that was way too optimistic :) We have since abandoned pytorch, and Im currently looking through the ml-agent python scripts to figure out how to convert our agents to .nn's. I'll share some more details over email |
Ok, lets move it to the email! :) |
Hi! Are there any updates on this? I have generated pytorch models as .pt or .pth files and would like to load them into Unity. It would be great to convert them into .nn files or import them directly or at least know when they will be supported. Thank you. |
We convert to pytorch to onnx
https://pytorch.org/docs/stable/onnx.html then
to nn with onnx_to_barracuda
https://github.com/mantasp/barracuda-release/tree/release/0.2.4/Tools
…On Fri, Aug 16, 2019 at 8:36 PM kumarict ***@***.***> wrote:
Hi! Are there any updates on this? I have generated pytorch models as .pt
or .pth files and would like to load them into Unity. It would be great to
convert them into .nn files or import them directly or at least know when
they will be supported. Thank you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1789?email_source=notifications&email_token=ABC3MW6A63K3NZHFPELHJSDQE3XUVA5CNFSM4G3ZVCDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4PMGYI#issuecomment-522109793>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABC3MWYQET4TV4HAXGNFLODQE3XUVANCNFSM4G3ZVCDA>
.
|
Hello @bassmit ! I followed your steps but when I have to drag my model into the agent in Unity I have this following error: "NullReferenceException: Object reference not set to an instance of an object" Versions: Traceback (most recent call last): Did you do any more step? Thank you ! |
I'm closing and locking this issue in favor of #3398 |
Hi, sorry to ask this here, but I can find very little on google. We have a trained agent that we would like to run in unity. Currently this is trained with pytorch and is in the form of a .pth file. Is there any way I can import this in to unity, perhaps by converting it to a .nn file?
Thanks, Bas
The text was updated successfully, but these errors were encountered: