netdef_models icon indicating copy to clipboard operation
netdef_models copied to clipboard

Controller eval code wrong in readme (part 1)

Open franciscorba opened this issue 6 years ago • 0 comments

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
  1. 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

franciscorba avatar Dec 18 '18 11:12 franciscorba