lmb-freiburg / netdef_models

Repository for different network models related to flow/disparity (ECCV 18)
GNU General Public License v3.0
157 stars 32 forks source link

Controller eval code wrong in readme (part 1) #10

Open franciscorba opened 5 years ago

franciscorba commented 5 years ago

When I tried to run your examples code I get this:

import netdef_slim as nd
nd.load_module('FlowNet3/CSS/controller.py')
Using /home/brisa/frbarbos/lmbspecialops/build/lib/lmbspecialops.so
<module 'None' from 'FlowNet3/CSS/controller.py'>
c = Controller()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Controller' is not defined

I found to possible solutions:

  1. save the output of load_module is a variable:
    import netdef_slim as nd
    M = nd.load_module('FlowNet3/CSS/controller.py')
    Using /home/brisa/frbarbos/lmbspecialops/build/lib/lmbspecialops.so
    c = M.Controller()
    evolution <00__flyingThings3D.train__S_fine_half>: 00__flyingThings3D.train__S_fine_half        COMPLETE
  2. Using directly Controller in the load_module output:
    import netdef_slim as nd
    c = nd.load_module('FlowNet3/CSS/controller.py').Controller()
    Using /home/brisa/frbarbos/lmbspecialops/build/lib/lmbspecialops.so
    evolution <00__flyingThings3D.train__S_fine_half>: 00__flyingThings3D.train__S_fine_half        COMPLETE