Giter Club home page Giter Club logo

Comments (4)

medasuryatej avatar medasuryatej commented on August 18, 2024 5

I did the following change, and some how it worked for me.
first, add this import command in "udc_predict.py"
from tensorflow.contrib.learn.python.learn.estimators import *

change the following line from
estimator._targets_info = tf.contrib.learn.estimators.tensor_signature.TensorSignature(tf.constant(0, shape=[1,1]))
to
estimator._targets_info = tensor_signature.TensorSignature(tf.constant(0, shape=[1,1]))

Also at the bottom, change the print command from
print("{}: {:g}".format(r, prob[0,0]))
to
print("{}: {:g}".format(r, next(prob)[0]))

Hope it helps. I am using Tensorflow Version 1.8, Python 3.6.5

from chatbot-retrieval.

XutongLi avatar XutongLi commented on August 18, 2024

i cannot find any useful solution _ORZ

from chatbot-retrieval.

muba1 avatar muba1 commented on August 18, 2024

having the similar issue in google colab? tf 2.0

feature_columns = tf.contrib.learn.infer_real_valued_columns_from_input_fn
module 'tensorflow' has no attribute 'contrib'

from chatbot-retrieval.

cddypang avatar cddypang commented on August 18, 2024
  1. the error is in function 'create_model_fn' in udc_model.py,
    move "batch_size = targets.get_shape().as_list()[0]" after "if mode == tf.contrib.learn.ModeKeys.EVAL:" can fix this problem.

the reason is when in PREDICT mode, model_fn deal the param 'targets' as None.

  1. "prob = estimator.predict(input_fn=input_fn, as_iterable=False)" in cdc_predict.py,
    the param 'as_iterable' default value is True, change to False,
    the next line "prob[0,0]" can execute correct.

from chatbot-retrieval.

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.