-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
pytorch model loader #37
Comments
We're not planning on supporting pytorch in the immediate future, however there is a path to use the old checkpoint loader with pytorch. The legacy loader with the pytorch weight-dumper script can be used: https://github.com/PAIR-code/deeplearnjs-legacy-loader The legacy loader currently depends on deeplearn, so you're going to have a dependency problem for the JS (the python will still work). Thankfully, all of the logic lives in a single file with 1 dependency (Tensor). This means you could just copy this file into your project: https://github.com/PAIR-code/deeplearnjs-legacy-loader/blob/master/src/checkpoint_loader.ts You can swap the import of 'deeplearn' with '@tensorflow/tfjs' or '@tensorflow/tfjs-core' and it should just work. |
Thanks a lot for the pointer. I will try that. |
I had a .pth file (containing a pytorch model I presume) and using the method outlined above I was able to get the output: a long list of _weight and _bias files, as well as one manifest.json file. This is in line with what's described here. Finally calling the |
* Use nightly tensorflow for linux and revert to using bundled eager header. * Add clean and only download libtensorflow once. * Use custom libtensorflow still.
* Update render function docs * update dev dependency
deeplearn.js supported some level of conversion of pytorch models via python scripts
Will this functionality be ported to tfjs or is this out of scope now that the framework is aiming for a tensorflow only solution?
The text was updated successfully, but these errors were encountered: