Commit 2fb8f750 authored by Yuxin Wu's avatar Yuxin Wu

disable callbacks.setter, make it a property

parent a26226f7
......@@ -124,7 +124,7 @@ def get_config():
dataflow=get_data(opt.data),
callbacks=[ModelSaver()],
steps_per_epoch=300,
max_epoch=100,
max_epoch=200,
)
......
......@@ -94,8 +94,8 @@ class TrainConfig(object):
MovingAverageSummary(),
ProgressBar(),
MergeAllSummaries()]
self.callbacks = callbacks + extra_callbacks
assert_type(self.callbacks, list)
self._callbacks = callbacks + extra_callbacks
assert_type(self._callbacks, list)
if monitors is None:
monitors = [TFSummaryWriter(), JSONWriter(), ScalarPrinter()]
......@@ -170,6 +170,10 @@ class TrainConfig(object):
def nr_tower(self, value):
self.tower = list(range(value))
@property
def callbacks(self): # disable setter
return self._callbacks
@property
def optimizer(self):
""" for back-compatibilty only. will remove in the future"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment