Giter Site home page Giter Site logo

error model_rgb.train() about s2vt HOT 4 OPEN

chenxinpeng avatar chenxinpeng commented on May 27, 2024
error model_rgb.train()

from s2vt.

Comments (4)

knwng avatar knwng commented on May 27, 2024

I've removed all the tf.get_variable_scope().reuse_variables() and solve this problem, but I'm new to tf and not clear about the consequence.

from s2vt.

Tsingzao avatar Tsingzao commented on May 27, 2024

It seems adding a scope before model construction is feasible.

with tf.variable_scope(tf.get_variable_scope()) as scope:
    tf_loss, tf_video, tf_video_mask, tf_caption, tf_caption_mask, tf_probs = model.build_model()

from s2vt.

holibert avatar holibert commented on May 27, 2024

def build_model(self): tf.variable_scope().reuse_variables() def build_generator(self): tf.variable_scope().reuse_variables()

change to

with tf.variable_scope("model") as scope: scope.reuse_variables() with tf.variable_scope("generator") as scope: scope.reuse_variables()

It works. I'm new in tensorflow. Now I can't tell what happened.

from s2vt.

zhengxinyu0825 avatar zhengxinyu0825 commented on May 27, 2024

@Dateios Did you meet this error after adding a scope? I fix the previous error using your solution, however, i meet the following error.
/home2/xzhe3946/S2VT/model_RGB.py in build_model(self)
66 with tf.variable_scope("LSTM1"):
67 tf.reset_default_graph()
---> 68 output1, state1 = self.lstm1(image_emb[:,i,:], state1)
69
70 with tf.variable_scope("LSTM2"):

/usr/lib/python2.7/contextlib.pyc in exit(self, type, value, traceback)
33 value = type()
34 try:
---> 35 self.gen.throw(type, value, traceback)
36 raise RuntimeError("generator didn't stop after throw()")
37 except StopIteration, exc:

/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.pyc in variable_scope(name_or_scope, default_name, values, initializer, regularizer, caching_device, partitioner, custom_getter, reuse, dtype)
1461 old_name_scope=scope,
1462 dtype=dtype) as vs:
-> 1463 yield vs
1464
1465

/usr/lib/python2.7/contextlib.pyc in exit(self, type, value, traceback)
33 value = type()
34 try:
---> 35 self.gen.throw(type, value, traceback)
36 raise RuntimeError("generator didn't stop after throw()")
37 except StopIteration, exc:

/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.pyc in get_controller(self, default)
3614 finally:
3615 if self._enforce_nesting:
-> 3616 if self.stack[-1] is not default:
3617 raise AssertionError(
3618 "Nesting violated for default stack of %s objects"

IndexError: list index out of range

from s2vt.

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.