stanford-tensorflow-tutorials
stanford-tensorflow-tutorials copied to clipboard
AttributeError: module 'config' has no attribute 'DEC_VOCAB'
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?
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)
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
it looks like
NUM_SAMPLES = 512
ENC_VOCAB = 24513
DEC_VOCAB = 24674