-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (19 loc) · 769 Bytes
/
Copy pathmain.py
File metadata and controls
32 lines (19 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 14 23:21:52 2017
"""
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tfrecord_converter import TfConverter
from batch_generator import BatchGenerator
# shuffle_data = True # shuffle the addresses before saving
cats_dogs_train_path = 'training_set/images/*.jpg'
conv = TfConverter()
addrs, labels = conv.prepare(cats_dogs_train_path)
train_set, valid_set, test_set = conv.train_test_valid_set(addrs, labels)
#conv.create_records(train_set, 'train_set.tfrecords')
#conv.create_records(test_set, 'test_set.tfrecords')
conv.create_records(valid_set, 'valid_set.tfrecords')
BatchGenerator().generate('valid_set.tfrecords')