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

Add tf.util.fetch() #1439

Closed
dsmilkov opened this issue Mar 22, 2019 · 3 comments · Fixed by tensorflow/tfjs-core#1663
Closed

Add tf.util.fetch() #1439

dsmilkov opened this issue Mar 22, 2019 · 3 comments · Fixed by tensorflow/tfjs-core#1663
Assignees

Comments

@dsmilkov
Copy link
Contributor

dsmilkov commented Mar 22, 2019

Add tf.util.fetch() as a cross-platform utility which mimics browser's fetch.

The weights loader should use this util instead of the global fetch (see weights_loader.ts) if the user hasn't provided a custom fetchFunc.

tf.util.fetch() should first check for the existence of a global fetch using tf.ENV.global.fetch. Then fallback for platform-specific solutions. The current platform-specific solution should be to use node-fetch when the environment is node.

Platforms such as wechat can override their global fetch fetch = customFetch, which will then be used by all fetching inside the TF.js eco-system (model loading, weights loading, etc)

@Kriyszig
Copy link
Contributor

I would love to work on this if annxingyuan hasn't started working on it yet

@annxingyuan
Copy link
Contributor

hey @Kriyszig - sorry I didn't notice your comment until today! I'm finishing this up now :) Thank you for the offer though!

@Kriyszig
Copy link
Contributor

I'll try my hand at something else. Thanks @annxingyuan (^_^)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants