stanford-tensorflow-tutorials icon indicating copy to clipboard operation
stanford-tensorflow-tutorials copied to clipboard

AttributeError: module 'config' has no attribute 'DEC_VOCAB'

Open yinseng2001 opened this issue 7 years ago • 3 comments

File "/Users/apple/tensorflow/stanford-tensorflow-tutorials/assignments/chatbot/model.py", line 51, in _inference if config.NUM_SAMPLES > 0 and config.NUM_SAMPLES < config.DEC_VOCAB: AttributeError: module 'config' has no attribute 'AttributeError: module 'config' has no attribute 'DEC_VOCAB''

I cannot file DEC_VOCAB and NUM_SAMPLES in config file, which number should i use for both value?

yinseng2001 avatar Sep 05 '17 11:09 yinseng2001

Check Tensorflow version: sampled_loss function. try the code below

def sampled_loss(labels, logits): labels = tf.reshape(labels, [-1, 1]) return tf.nn.sampled_softmax_loss(tf.transpose(w), b, labels, logits, config.NUM_SAMPLES, config.DEC_VOCAB)

kiranvarghesev avatar Jun 26 '18 07:06 kiranvarghesev

if i rememberer correctly. this values is added automatic after you run data.py. because data.py create vocabs and add length to config file every time you run data.py new line is added at the end of config file

MartinAbilev avatar Jun 26 '18 08:06 MartinAbilev

it looks like

NUM_SAMPLES = 512
ENC_VOCAB = 24513
DEC_VOCAB = 24674

MartinAbilev avatar Jun 26 '18 08:06 MartinAbilev