Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Undefined names: Missing imports, etc. #115

Open
cclauss opened this issue Oct 17, 2018 · 0 comments
Open

Undefined names: Missing imports, etc. #115

cclauss opened this issue Oct 17, 2018 · 0 comments

Comments

@cclauss
Copy link

cclauss commented Oct 17, 2018

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant