Hvass-Labs / TensorFlow-Tutorials

TensorFlow Tutorials with YouTube Videos
MIT License
9.28k stars 4.19k forks source link

Issue for displaying miss-classified images with new dataset in Tutorial 10 #82

Closed NoYo25 closed 6 years ago

NoYo25 commented 6 years ago

Hello Magnus,

Thanks for all these tutorials, you don't know how did you save my time! I have a problem with Tutorial #10. I am trying to use another dataset, I am using Leeds Butterfly.

My problem is: I cannot display a sample of the trained images using plot_images(images=images, cls_true=cls_true, smooth=True). It always got a wrong True class label. and of course the same issue for plotting miss-classified examples using example_errors()

What I did I formatted it like train/classes then images i.e. train/ ------>/001 ------>/002 ------>... etc

I tried to create .pkl the cache file you already used in Knifey dataset but it didn't work; the model still trains the examples in random way, so the 2 functions mentioned above are no longer work.

I need something to get a sample of the test_data which tell me (image itself, correct label, predict label) then I will be able to plot it. or tell me how to make the cache file works to ensure the order of the data entries.

P.S. for the cache file, I did nothing new, I just put the dataset in the correct format then I called the dataset = load().

================================== Dataset section in fine_tuning.ipynb changed to

import leedsButterfly leedsButterfly.maybe_download_and_extract() leedsButterfly.build_dataset() leedsButterfly.copy_files()

You can find my leedsbutterfly.py here

Please advice. Thanks in advance Nora Youssef

Hvass-Labs commented 6 years ago

Thanks for the compliment I'm glad my work is helping you.

There are thousands of people building on my work and it would be impossible for me to help them make modifications, so unfortunately I cannot help you.

It has also been a very long time since I did this - I think almost 2 years. But a few things you could try: If the code uses a pickle-cache-file then try and delete everything in the dir and cache-dir and run it again. You can also try and skip the cache-creation in the code. If that doesn't work, you'll have to debug to find the problem.