Giter Site home page Giter Site logo

Comments (3)

bradleyboehmke avatar bradleyboehmke commented on June 28, 2024 2

I was catching up on the CNN visualization notebooks today. There's two ways to resolve this:

  1. Using TF 2.0 GradientTape as in here.
  2. Disabling eager execution at the top of the script with tf$compat$v1$disable_eager_execution().

Neither of them have side effects on the rest of the notebook code chunks so I'll probably just use tf$compat$v1$disable_eager_execution().

from dl-keras-tf.

bradleyboehmke avatar bradleyboehmke commented on June 28, 2024 1

Good catch @OmaymaS. That is a notebook that I haven't really done anything with. I grabbed it from JJ Allaire's book repo but planned to revise it and base it on the Cats vs. Dogs model. When I do the revision I will try work out this issue.

from dl-keras-tf.

DiabbZegpi avatar DiabbZegpi commented on June 28, 2024

I was catching up on the CNN visualization notebooks today. There's two ways to resolve this:

  1. Using TF 2.0 GradientTape as in here.
  2. Disabling eager execution at the top of the script with tf$compat$v1$disable_eager_execution().

Neither of them have side effects on the rest of the notebook code chunks so I'll probably just use tf$compat$v1$disable_eager_execution().

Doing tihs also results in an error (I'm also following the cats vs dogs example on "Visualizing convnet filters"):
Error in py_call_impl():

! TypeError: You are passing KerasTensor(type_spec=TensorSpec(shape=(), dtype=tf.float32, name=None), name='tf.math.reduce_mean/Mean:0', description="created by layer 'tf.math.reduce_mean'"), an intermediate Keras symbolic input/output, to a TF API that does not allow registering custom dispatchers, such as `tf.cond`, `tf.function`, gradient tapes, or `tf.map_fn`. Keras Functional model construction only supports TF API calls that *do* support dispatching, such as `tf.math.add` or `tf.reshape`. Other APIs cannot be called directly on symbolic Kerasinputs/outputs. You can work around this limitation by putting the operation in a custom Keras layer `call` and calling that layer on this symbolic input/output.

from dl-keras-tf.

Related Issues (11)

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.