KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
As far as I understand, a python module is never imported twice, i.e. the code in the module only gets executed the first time it is imported. Subsequent import statements just add the module to the scope of the import. I have a module called "TiledConvC3D.py" that seems to be imported multiple times though. I use pdb to print the stack at the top of the code for this module. Here is the end of the stack trace from the first time the module is executed: File "<anonymized>/python_modules/Theano/theano/gof/cmodule.py", line 328, in refresh key = cPickle.load(open(key_pkl, 'rb')) File "<anonymized>/ops/TiledConvG3D.py", line 565, in <module> import TiledConvC3D File "<anonymized>/ops/TiledConvC3D.py", line 18, in <module> pdb.traceback.print_stack() It goes on to be executed several more times. However, the complete stack trace for the second time it is called does not show any calls to reload , so these executions should not be occurring: File "sup_train_conj_grad.py", line 103, in <module> dataset = Config.get_dataset(dataset_node) File "<anonymized>/Config.py", line 279, in get_dataset from datasets import NewWiskott File "<anonymized>/datasets/NewWiskott.py", line 16, in <module> normalizer_train = video.ContrastNormalizer3D(sigma, global_per_frame = False, input_is_5d = True) File "<anonymized>/util/video.py", line 204, in __init__ self.f = theano.function([input],output) File "<anonymized>/python_modules/Theano/theano/compile/function.py", line 105, in function allow_input_downcast=allow_input_downcast) File "<anonymized>/python_modules/Theano/theano/compile/pfunc.py", line 270, in pfunc accept_inplace=accept_inplace, name=name) File "<anonymized>/python_modules/Theano/theano/compile/function_module.py", line 1105, in orig_function fn = Maker(inputs, outputs, mode, accept_inplace = accep
Tags (comma-separated)
Save Edits
Cancel