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

Find a nicer way to download kaggle TensorFlow models #96

Open
eulersson opened this issue Jan 28, 2024 · 0 comments
Open

Find a nicer way to download kaggle TensorFlow models #96

eulersson opened this issue Jan 28, 2024 · 0 comments
Labels
cosmetic Small unimportant typos or bugs

Comments

@eulersson
Copy link
Owner

There used to be a python package called "tensorflow_hub" that would act as an interface to download the ML models instead of having to find the tarball paths. I'm scared the paths might change, so using a client library to interact with these repositories would probably be safer.

# TODO: There might be a better way to download the model from Kaggle (former TensorFlow Hub).
model_tarball_path = os.path.join(
os.path.dirname(__file__), "yamnet-classification.tar.gz"
)
if not os.path.exists(model_tarball_path):
urllib.request.urlretrieve(
"https://www.kaggle.com/models/google/yamnet/frameworks/TfLite/variations/classification-tflite/versions/1/download",
model_tarball_path,
)
model_path = os.path.join(os.path.dirname(__file__), "1.tflite")
if not os.path.exists(model_path):
file = tarfile.open(model_tarball_path)
file.extractall(".")
file.close()

@eulersson eulersson converted this from a draft issue Jan 28, 2024
@eulersson eulersson added the cosmetic Small unimportant typos or bugs label Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmetic Small unimportant typos or bugs
Projects
Status: No status
Development

No branches or pull requests

1 participant