Skip to content

TypeError: only integer scalar arrays can be converted to a scalar index #3

@whyeverwhy

Description

@whyeverwhy

First of all sorry for the rather futile question, I know this doesn't seem specifically about the code itself but couldn't find the solution. My problem is that I can't generate the .gif files due to this error.

TypeErrorTraceback (most recent call last)
<ipython-input-80-2954e669139d> in <module>()
----> 1 sampler.save_anim_gif(z1, z2, 'output.gif')

/content/drive/cppn/sampler.py in save_anim_gif(self, z1, z2, filename, n_frame, duration1, duration2, duration, x_dim, y_dim, scale, reverse)
    115       durations = durations + [duration]*n_frame + [duration1]
    116     print ("writing gif file...")
--> 117     writeGif(filename, images, duration = durations)
    118     im.save(filename)

/content/drive/images2gif.py in writeGif(filename, images, duration, repeat, dither, nq, subRectangles, dispose)
    560     # Check subrectangles
    561     if subRectangles:
--> 562         images, xy = gifWriter.handleSubRectangles(images, subRectangles)
    563         defaultDispose = 1 # Leave image in place
    564     else:

/content/drive/cppn/images2gif.py in handleSubRectangles(self, images, subRectangles)
    298 
    299             # Determine the sub rectangles
--> 300             images, xy = self.getSubRectangles(images)
    301 
    302         # Done

/content/drive/cppn/images2gif.py in getSubRectangles(self, ims)
    350 
    351             # Cut out and store
--> 352             im2 = im[y0:y1,x0:x1]
    353             prev = im
    354             ims2.append(im2)

TypeError: only integer scalar arrays can be converted to a scalar index

My guess was that it is due to version of Tensorflow, so I updated everything [along with the amended version of images2gif.py] but still didn't work.

I really would appreciate any help on this.

Thanks very much for this wonderful thing.

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