GithubHelp home page GithubHelp logo

Comments (3)

raghakot avatar raghakot commented on July 26, 2024 2

Did you try installing from source? I wrap the output as a list so it should have len in both python 2 and 3

from keras-vis.

raghakot avatar raghakot commented on July 26, 2024

It's because filter returns an Iterator in python3. Fixed.

from keras-vis.

jskDr avatar jskDr commented on July 26, 2024

It is not fixed. I still have the same error. If it is my special case, please ignore this comment.


TypeError Traceback (most recent call last)
in ()
----> 1 opt.minimize(max_iter=500, verbose=True, image_modifiers=[Jitter()], callbacks=[GifGenerator('opt_progress')])

C:\ProgramData\Anaconda3\lib\site-packages\vis\optimizer.py in minimize(self, seed_img, max_iter, image_modifiers, callbacks, verbose)
132 # Trigger callbacks
133 for c in callbacks:
--> 134 c.callback(i, named_losses, overall_loss, grads, wrt_value)
135
136 # Gradient descent update.

C:\ProgramData\Anaconda3\lib\site-packages\vis\callbacks.py in callback(self, i, named_losses, overall_loss, grads, wrt_value)
59 def callback(self, i, named_losses, overall_loss, grads, wrt_value):
60 img = utils.deprocess_image(wrt_value[0])
---> 61 img = utils.draw_text(img, "Step {}".format(i + 1))
62 self.writer.append_data(img)
63

C:\ProgramData\Anaconda3\lib\site-packages\vis\utils\utils.py in draw_text(img, text, position, font, font_size, color)
230
231 font_files = _find_font_file(font)
--> 232 if len(font_files) == 0:
233 logger.warn("Failed to lookup font '{}', falling back to default".format(font))
234 font = ImageFont.load_default()

TypeError: object of type 'filter' has no len()

from keras-vis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.