Hub | Activeloop
GitHub
Activeloop Login
Slack
Search…
v2.0.2
🏠
Home
Quickstart
API Basics
EXAMPLE CODE
Getting Started
Step 1: Hello World
Step 2: Creating Hub Datasets Manually
Step 3: Understanding Compression
Step 4: Improving Performance via "with" Syntax
Step 5: Accessing Data
Step 6: Using Activeloop Storage
Step 7: Connecting Hub Datasets to ML Frameworks
Tutorials
DOCUMENTATION
API Reference
How Hub Works
Design Principles
How to Contribute
Archive
Powered By
GitBook
Step 7: Connecting Hub Datasets to ML Frameworks
Connecting Hub Datasets to machine learning frameworks such as PyTorch and TensorFlow.
You can connect Hub Datasets to popular ML frameworks such as PyTorch and TensorFlow using minimal boilerplate code.
PyTorch
You can train a model by creating a PyTorch DataLoader from a Hub Dataset using
ds.pytorch()
.
from
Hub
import
Dataset
from
torch
.
utils
.
data
import
DataLoader
ds
=
Dataset
(
'./dataset_path'
)
# Hub Dataset
dataloader
=
ds
.
pytorch
()
#PyTorch Dataloader
for
data
in
dataloader
:
print
(
data
)
# Training Loop
TensorFlow - Coming Soon
Similarly, you can convert a Hub Dataset to a TensorFlow Dataset via the
tf.Data
API.
ds
# Hub Dataset object, to be used for training
ds
=
ds
.
tensorflow
()
# A TensorFlow Dataset
Previous
Step 6: Using Activeloop Storage
Next
Tutorials
Last modified
1yr ago
Copy link
Outline
PyTorch
TensorFlow - Coming Soon