Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutOfRangeError when trying to run pokeGAN.py #10

Open
ayrtondenner opened this issue Feb 11, 2018 · 1 comment
Open

OutOfRangeError when trying to run pokeGAN.py #10

ayrtondenner opened this issue Feb 11, 2018 · 1 comment

Comments

@ayrtondenner
Copy link

When I'm trying to run pokeGAN.py, line 225 throws the following error: tensorflow.python.framework.errors_impl.OutOfRangeError: RandomShuffleQueue '_0_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 64, current size 0)
[[Node: shuffle_batch = QueueDequeueManyV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, shuffle_batch/n)]]

While this error is throwing during the train_image = sess.run(image_batch) instruction, it seems to be related to line 58, where is defined a shuffle batch instruction:

    images_batch = tf.train.shuffle_batch(
                                    [image], batch_size = BATCH_SIZE,
                                    num_threads = 4, capacity = 200 + 3* BATCH_SIZE,
                                    min_after_dequeue = 200)

I couldn't find anyone else on the internet with the same mistake, but it happens when I try to run this code without any changes.

@AaronWard
Copy link

AaronWard commented Jun 4, 2018

@ayrtondenner I may be a little late on this but i found by setting a guard on the image import fixed this problem for me. Initially i thought it had something to do with the number of samples in the dataset but that wasn't the problem

Here is what i did, i inserted if each.endswith(".png"): to make make sure only png images were being imported as sometimes there can be a hidden .ini file

def process_data():   
    
    print('importing data...')
    images = []

    #import every file with a png extension
    for each in os.listdir(TRAINING_DIR):
        if each.endswith(".png"): 
            images.append(os.path.join(TRAINING_DIR,each))

    # print images    
    all_images = tf.convert_to_tensor(images, dtype = tf.string)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants