Skip to content

Base on Tensorflow official quickstart, but to load train data locally(offline) instead of downloading online, avoid blocking by GFW in China or others.

License

Notifications You must be signed in to change notification settings

archongum/tensorflow-quickstart-offline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tensorflow-quickstart-offline

Base on Tensorflow official quickstart, but to load train data locally(offline) instead of downloading online, avoid blocking by GFW in China or others.

For whom

Blocked by GFW(like China) can't download tensorflow.keras.datasets.* by calling load_data() methods.

Method

keras.datasets local_datasets
imdb.get_word_index get_word_index
imdb.load_data load_data_imdb
mnist.load_data load_data_mnist
fashion_mnist.load_data load_data_fashion_mnist
boston_housing.load_data load_data_boston_housing

Usage

For quick start

Open notebook in official_quickstart.

For your examples project

copy utils directory to any project.

python

from utils.local_datasets import load_data_fashion_mnist

(train_images, train_labels), (test_images, test_labels) = load_data_fashion_mnist()

jupyter notebook

import os
import sys
# add utils path to sys.path in order to import
# PS: be aware of the absolute path of utils
module_path = os.path.abspath(os.path.join('utils'))
if module_path not in sys.path:
    sys.path.append(module_path)
    
from local_datasets import load_data_fashion_mnist

(train_images, train_labels), (test_images, test_labels) = load_data_fashion_mnist()

About

Base on Tensorflow official quickstart, but to load train data locally(offline) instead of downloading online, avoid blocking by GFW in China or others.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published