kwotsin / create_tfrecords Goto Github PK
View Code? Open in Web Editor NEWA simpler way of preparing large-scale image dataset by generalizing functions from TensorFlow-slim
License: MIT License
A simpler way of preparing large-scale image dataset by generalizing functions from TensorFlow-slim
License: MIT License
my data is not organized according to classes.
how should I do it in an efficient way?
Running this error on windows will not happen on Ubuntu:OverflowError: Python int too large to convert to C long.
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
I want to modify the Int64 bit uint32, but tensorflow only supports Int64, float, string. What should I do?
Sir,I'm a beginner of deep learning and tensorflow , now I want to use the classification model I have trained on my own dataset to classify images which are all .jpg files,and the number of images I'd like to classify is about 3000,if I read and classify them one by one,the time is too long,do you have some suggestions about it?
Hey Kwotsin,
Thanks for this repo! I really need something like this!
I found a little problem though, the _get_filenames_and_classes() function returns empty lists for both the photo_filenames and class_names, any idea what could be wrong?
Thanks in advanced!
@kwotsin Thanks for the code! Do you have any idea about how the number of shards affects the tfrecords' reading efficiency.
I'm trying to create tf records on my own dataset on my mac, already divided in subfolders (one sub folder for class) but the output .tfrecord files are all empty. No errors are displayed, any ideas?
EDIT
If someone else got this issue, make sure you put the subfolders named as the classes in a folder that in turn is contained (but it is the only one) in another folder.
I think your method will create the tfrecords with the origin image size. Then how to decode the tfrecords with images which have different sizes. Thanks for replying.
How can I change a numpy ndarray into tfrecord? Should I change the numpy matrix into string. Which decoder should I use? slim.tfexample_decoder.Tensor(). I used np.array2string to change the matrix to string but I failed to convert the tfrecord file back to numpy array.
TF is expecting bytes to the 'jpg' on line 202 in dataset_utils.py
So,
example = image_to_tfexample( image_data, b'jpg', height, width, class_id) tfrecord_writer.write(example.SerializeToString())
solves the problem
Hi,
Thanks for sharing this tfrecords creating code. I found it very useful. But when I'm running the code (I'm using exactly the same code as you shared) I'm getting 4 tfrecord files of 0 kb.
I'm using windows and running the following code in command prompt:
python TFRecords.py --tfrecord_filename=flowers --dataset_dir=D:/Transfer_Learning_Practice/flowers/flower_photos/
I'm not getting any errors in the execution. The final result is
Finished converting the flowers dataset!
Could you please tell me where I could make the mistake?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.