[GitHub] ysh329 commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-13 Thread git
ysh329 commented on a change in pull request #7363: Add tensorboard configure 
into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r132864621
 
 

 ##
 File path: example/image-classification/train_mnist.py
 ##
 @@ -75,5 +75,13 @@ def get_mnist_iter(args, kv):
 net = import_module('symbols.'+args.network)
 sym = net.get_symbol(**vars(args))
 
+# tensorboard logs
+train_log = 'logs/mnist/train'
+eval_log = 'logs/mnist/eval'
+batch_end_callbacks = 
[mx.contrib.tensorboard.LogMetricsCallback(train_log)]
 
 Review comment:
   So stupid I am, I forgot `make` and `pip install -e .`. It's okay on current 
master branch.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ysh329 commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-11 Thread git
ysh329 commented on a change in pull request #7363: Add tensorboard configure 
into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r132632691
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -168,10 +168,16 @@ def fit(args, network, data_loader, **kwargs):
 
 # callbacks that run after each batch
 batch_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
+eval_end_callbacks = []
 if 'batch_end_callback' in kwargs:
 cbs = kwargs['batch_end_callback']
 batch_end_callbacks += cbs if isinstance(cbs, list) else [cbs]
 
+# tensorboard logs
+if "eval_end_callback" in kwargs:
+   cbs = kwargs['eval_end_callback']
+eval_end_callbacks += cbs if isinstance(cbs, list) else [cbs]
 
 Review comment:
   modified as direct way
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ysh329 commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-11 Thread git
ysh329 commented on a change in pull request #7363: Add tensorboard configure 
into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r132612116
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -168,10 +168,16 @@ def fit(args, network, data_loader, **kwargs):
 
 # callbacks that run after each batch
 batch_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
+eval_end_callbacks = []
 if 'batch_end_callback' in kwargs:
 cbs = kwargs['batch_end_callback']
 batch_end_callbacks += cbs if isinstance(cbs, list) else [cbs]
 
 Review comment:
   @zihaolucky 
   I assigned `eval_end_callbacks` with same value as `batch_end_ballbacks`, 
but log about validation set still print for each epoch, not 
`args.disp_batches`.
   ```Python
   batch_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
   eval_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
   ```
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ysh329 commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-10 Thread git
ysh329 commented on a change in pull request #7363: Add tensorboard configure 
into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r132612116
 
 

 ##
 File path: example/image-classification/common/fit.py
 ##
 @@ -168,10 +168,16 @@ def fit(args, network, data_loader, **kwargs):
 
 # callbacks that run after each batch
 batch_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
+eval_end_callbacks = []
 if 'batch_end_callback' in kwargs:
 cbs = kwargs['batch_end_callback']
 batch_end_callbacks += cbs if isinstance(cbs, list) else [cbs]
 
 Review comment:
   @zihaolucky 
   I assigned `eval_end_callbacks` with same value as `batch_end_ballbacks`, 
but log about validation set still print for each epoch, not 
`args.disp_batches`.
   ```Python
batch_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
   eval_end_callbacks = [mx.callback.Speedometer(args.batch_size, 
args.disp_batches)]
   ```
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ysh329 commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-07 Thread git
ysh329 commented on a change in pull request #7363: Add tensorboard configure 
into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r131638833
 
 

 ##
 File path: example/image-classification/train_mnist.py
 ##
 @@ -75,5 +75,13 @@ def get_mnist_iter(args, kv):
 net = import_module('symbols.'+args.network)
 sym = net.get_symbol(**vars(args))
 
+# tensorboard logs
+train_log = 'logs/mnist/train'
+eval_log = 'logs/mnist/eval'
+batch_end_callbacks = 
[mx.contrib.tensorboard.LogMetricsCallback(train_log)]
 
 Review comment:
   @zihaolucky After `pip install tensorboard` in Docker, I found another 
problem :sob: 
   ```Shell
   
root@65ea267b5b52:~/incubator-mxnet-0.10.0.post2/example/image-classification# 
python train_mnist.py 
   INFO:root:start with arguments Namespace(add_stn=False, batch_size=64, 
disp_batches=100, dtype='float32', gpus=None, kv_store='device', 
load_epoch=None, lr=0.05, lr_factor=0.1, lr_step_epochs='10', 
model_prefix=None, mom=0.9, monitor=0, network='mlp', num_classes=10, 
num_epochs=20, num_examples=6, num_layers=None, optimizer='sgd', test_io=0, 
top_k=0, wd=0.0001)
   Traceback (most recent call last):
 File "train_mnist.py", line 87, in 
   eval_end_callback = eval_end_callbacks)
 File 
"/root/incubator-mxnet-0.10.0.post2/example/image-classification/common/fit.py",
 line 197, in fit
   monitor= monitor)
 File "/mxnet/python/mxnet/module/base_module.py", line 465, in fit
   optimizer_params=optimizer_params)
 File "/mxnet/python/mxnet/module/module.py", line 478, in init_optimizer
   **optimizer_params)
 File "/mxnet/python/mxnet/optimizer.py", line 128, in create_optimizer
   return Optimizer.opt_registry[name.lower()](**kwargs)
 File "/mxnet/python/mxnet/optimizer.py", line 328, in __init__
   super(SGD, self).__init__(**kwargs)
   TypeError: __init__() got an unexpected keyword argument 'multi_precision'
   ```
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ysh329 commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-07 Thread git
ysh329 commented on a change in pull request #7363: Add tensorboard configure 
into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r131638833
 
 

 ##
 File path: example/image-classification/train_mnist.py
 ##
 @@ -75,5 +75,13 @@ def get_mnist_iter(args, kv):
 net = import_module('symbols.'+args.network)
 sym = net.get_symbol(**vars(args))
 
+# tensorboard logs
+train_log = 'logs/mnist/train'
+eval_log = 'logs/mnist/eval'
+batch_end_callbacks = 
[mx.contrib.tensorboard.LogMetricsCallback(train_log)]
 
 Review comment:
   @zihaolucky I found another problem :sob: 
   ```Shell
   
root@65ea267b5b52:~/incubator-mxnet-0.10.0.post2/example/image-classification# 
python train_mnist.py 
   INFO:root:start with arguments Namespace(add_stn=False, batch_size=64, 
disp_batches=100, dtype='float32', gpus=None, kv_store='device', 
load_epoch=None, lr=0.05, lr_factor=0.1, lr_step_epochs='10', 
model_prefix=None, mom=0.9, monitor=0, network='mlp', num_classes=10, 
num_epochs=20, num_examples=6, num_layers=None, optimizer='sgd', test_io=0, 
top_k=0, wd=0.0001)
   Traceback (most recent call last):
 File "train_mnist.py", line 87, in 
   eval_end_callback = eval_end_callbacks)
 File 
"/root/incubator-mxnet-0.10.0.post2/example/image-classification/common/fit.py",
 line 197, in fit
   monitor= monitor)
 File "/mxnet/python/mxnet/module/base_module.py", line 465, in fit
   optimizer_params=optimizer_params)
 File "/mxnet/python/mxnet/module/module.py", line 478, in init_optimizer
   **optimizer_params)
 File "/mxnet/python/mxnet/optimizer.py", line 128, in create_optimizer
   return Optimizer.opt_registry[name.lower()](**kwargs)
 File "/mxnet/python/mxnet/optimizer.py", line 328, in __init__
   super(SGD, self).__init__(**kwargs)
   TypeError: __init__() got an unexpected keyword argument 'multi_precision'
   ```
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ysh329 commented on a change in pull request #7363: Add tensorboard configure into ./common/fit.py and ./train_mnist.py

2017-08-07 Thread git
ysh329 commented on a change in pull request #7363: Add tensorboard configure 
into ./common/fit.py and ./train_mnist.py
URL: https://github.com/apache/incubator-mxnet/pull/7363#discussion_r131634218
 
 

 ##
 File path: example/image-classification/train_mnist.py
 ##
 @@ -75,5 +75,13 @@ def get_mnist_iter(args, kv):
 net = import_module('symbols.'+args.network)
 sym = net.get_symbol(**vars(args))
 
+# tensorboard logs
+train_log = 'logs/mnist/train'
+eval_log = 'logs/mnist/eval'
+batch_end_callbacks = 
[mx.contrib.tensorboard.LogMetricsCallback(train_log)]
 
 Review comment:
   Okay
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services