Coder Social home page Coder Social logo

ValueError Issu about indrnn HOT 4 CLOSED

sam9211 avatar sam9211 commented on August 16, 2024
ValueError Issu

from indrnn.

Comments (4)

batzner avatar batzner commented on August 16, 2024

Hi, can you provide details on which code you ran? Was it the examples/addition_rnn.py script or the example code in the Readme? Did you run it on master or another branch?

I hope, we can find the problem.

from indrnn.

sam9211 avatar sam9211 commented on August 16, 2024

I think it's something related with tf.variable_scope. When I run the addition_rnn.py script directly using python everything is OK, but if I copy the code into my Jupyter Notebook and run the bug happened. I have fixed the bug by adding:
with tf.variable_scope("indrnn", reuse=None):
in front of
output, state = tf.nn.dynamic_rnn(cell, inputs_ph, dtype=tf.float32)
and make all the rest code within that with loop, then it started running.

from indrnn.

batzner avatar batzner commented on August 16, 2024

The error usually occurs, when you run
output, state = tf.nn.dynamic_rnn(cell, inputs_ph, dtype=tf.float32)
twice. Then, it will create the variables again in the second call and complain that they already exist. It might be that you ran the cell Jupyter Notebook twice, so all the variables were already initialized. I have not used TensorFlow in Jupyter yet, but restarting the notebook would probably help in such cases. Apart from that you can also use the reuse parameter of a variable scope, as you mentioned above.

from indrnn.

sam9211 avatar sam9211 commented on August 16, 2024

Cool!
Tanks again!

from indrnn.

Related Issues (16)

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.