practical-pytorch icon indicating copy to clipboard operation
practical-pytorch copied to clipboard

Undefined names: Missing imports, etc.

Open cclauss opened this issue 7 years ago • 0 comments

flake8 testing of https://github.com/spro/practical-pytorch on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./seq2seq-translation/seq2seq-translation-batched.py:22:1: F821 undefined name 'matplotlib'
matplotlib.use('Agg')
^
./seq2seq-translation/seq2seq-translation-batched.py:56:11: F821 undefined name 'EncoderRNN'
encoder = EncoderRNN(input_lang.n_words, hidden_size, n_layers, dropout=dropout)
          ^
./seq2seq-translation/seq2seq-translation-batched.py:56:22: F821 undefined name 'input_lang'
encoder = EncoderRNN(input_lang.n_words, hidden_size, n_layers, dropout=dropout)
                     ^
./seq2seq-translation/seq2seq-translation-batched.py:57:11: F821 undefined name 'LuongAttnDecoderRNN'
decoder = LuongAttnDecoderRNN(attn_model, hidden_size, output_lang.n_words, n_layers, dropout=dropout)
          ^
./seq2seq-translation/seq2seq-translation-batched.py:57:56: F821 undefined name 'output_lang'
decoder = LuongAttnDecoderRNN(attn_model, hidden_size, output_lang.n_words, n_layers, dropout=dropout)
                                                       ^
./seq2seq-translation/seq2seq-translation-batched.py:460:18: F821 undefined name 'masked_cross_entropy'
importlib.reload(masked_cross_entropy)
                 ^
./seq2seq-translation/seq2seq-translation-batched.py:479:8: F821 undefined name 'masked_cross_entropy'
loss = masked_cross_entropy.compute_loss(
       ^
./seq2seq-translation/seq2seq-translation-batched.py:561:25: F821 undefined name 'target_length'
        for di in range(target_length):
                        ^
./seq2seq-translation/seq2seq-translation-batched.py:563:50: F821 undefined name 'target_variable'
            loss += criterion(decoder_output[0], target_variable[di])
                                                 ^
./seq2seq-translation/seq2seq-translation-batched.py:564:29: F821 undefined name 'target_variable'
            decoder_input = target_variable[di] # Next target is next input
                            ^
./seq2seq-translation/seq2seq-translation-batched.py:568:25: F821 undefined name 'target_length'
        for di in range(target_length):
                        ^
./seq2seq-translation/seq2seq-translation-batched.py:570:50: F821 undefined name 'target_variable'
            loss += criterion(decoder_output[0], target_variable[di])
                                                 ^
./seq2seq-translation/seq2seq-translation-batched.py:585:12: F821 undefined name 'masked_cross_entropy'
    loss = masked_cross_entropy.compute_loss(
           ^
./seq2seq-translation/seq2seq-translation-batched.py:711:73: F821 undefined name 'target_sentence'
    text = '<p>&gt; %s</p><p>= %s</p><p>&lt; %s</p>' % (input_sentence, target_sentence, output_sentence)
                                                                        ^
./seq2seq-translation/seq2seq-translation-batched.py:711:90: F821 undefined name 'output_sentence'
    text = '<p>&gt; %s</p><p>= %s</p><p>&lt; %s</p>' % (input_sentence, target_sentence, output_sentence)
                                                                                         ^
15    F821 undefined name 'matplotlib'
15

cclauss avatar Oct 17 '18 10:10 cclauss