Skip to content

ZeroDivisionError: integer division or modulo by zero #2

@garimss

Description

@garimss

hi when I run this part

loaded_graph=tf.Graph()
with tf.Session(graph=loaded_graph) as sess:
loader=tf.train.import_meta_graph('./encode_model.meta')
loader.restore(sess,tf.train.latest_checkpoint('./'))
inputs_=loaded_graph.get_tensor_by_name('Placeholder:0')
recon=loaded_graph.get_tensor_by_name('decoder/recon:0')
batch_x = get_batch(len(configfiles,6, batch_size=10)
#show_reconstructed(sess,batch_x,recon)

I get the error. Please suggest a solution.

INFO:tensorflow:Restoring parameters from ./encode_model


ZeroDivisionError Traceback (most recent call last)
in
6 inputs_=loaded_graph.get_tensor_by_name('Placeholder:0')
7 recon=loaded_graph.get_tensor_by_name('decoder/recon:0')
----> 8 batch_x = get_batch(configfiles, 0)
9 #show_reconstructed(sess,batch_x,recon)

in get_batch(configfiles, ibatch, batch_size)
1 def get_batch(configfiles,ibatch, batch_size=100):
2
----> 3 ibatch = ibatch % len(configfiles)
4
5 image_name_list_batch = configfiles[ibatch:ibatch+batch_size]

ZeroDivisionError: integer division or modulo by zero

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions