tomgoldstein / loss-landscape

Code for visualizing the loss landscape of neural nets
MIT License
2.79k stars 396 forks source link

Undefined name: import os for lines 9 and 10 #6

Closed cclauss closed 5 years ago

cclauss commented 5 years ago

flake8 testing of https://github.com/tomgoldstein/loss-landscape on Python 3.7.1

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

./cifar10/dataloader.py:7:16: F821 undefined name 'os'
        assert os.path.exists(trainloader_path), 'trainloader does not exist'
               ^
./cifar10/dataloader.py:7:31: F821 undefined name 'trainloader_path'
        assert os.path.exists(trainloader_path), 'trainloader does not exist'
                              ^
./cifar10/dataloader.py:8:16: F821 undefined name 'os'
        assert os.path.exists(testloader_path), 'testloader does not exist'
               ^
./cifar10/dataloader.py:8:31: F821 undefined name 'testloader_path'
        assert os.path.exists(testloader_path), 'testloader does not exist'
                              ^
./cifar10/dataloader.py:9:34: F821 undefined name 'trainloader_path'
        trainloader = torch.load(trainloader_path)
                                 ^
./cifar10/dataloader.py:10:33: F821 undefined name 'testloader_path'
        testloader = torch.load(testloader_path)
                                ^
6     F821 undefined name 'os'
6
ljk628 commented 5 years ago

Thanks for the fix!

cclauss commented 5 years ago

Sure. I could not find where __testloader_path__ is defined in this repo.

ljk628 commented 5 years ago

Oh, I see, it should be fixed by https://github.com/tomgoldstein/loss-landscape/commit/1afd340d70427e5e81dbbefb19cc51e6cc42c198