google / sg2im

Code for "Image Generation from Scene Graphs", Johnson et al, CVPR 2018
Apache License 2.0
1.29k stars 231 forks source link

Undefined names: 'conv' and 'Variable()' #1

Closed cclauss closed 6 years ago

cclauss commented 6 years ago

Undefined names have the potential to raise NameError at runtime...

flake8 testing of https://github.com/google/sg2im on Python 3.6.3

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

./sg2im/layers.py:57:28: F821 undefined name 'conv'
    nn.init.kaiming_normal(conv.weight)
                           ^
./sg2im/layers.py:59:29: F821 undefined name 'conv'
    nn.init.kaiming_uniform(conv.weight)
                            ^
./sg2im/losses.py:152:11: F821 undefined name 'Variable'
  x_hat = Variable(x_hat, requires_grad=True)
          ^
3     F821 undefined name 'conv'
3
jcjohnson commented 6 years ago

Fixed in https://github.com/google/sg2im/commit/2a4126b6bf53e328c88065cc3c57bce9e58b08aa