mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

what is the meaning of ouput in image_segmentation.py

Open liumilan opened this issue 10 years ago • 5 comments

fcnxs, fcnxs_args, fcnxs_auxs = mx.model.load_checkpoint(model_previx, epoch)
fcnxs_args["data"] = mx.nd.array(get_data(img), ctx)
data_shape = fcnxs_args["data"].shape
label_shape = (1, data_shape[2]*data_shape[3])
fcnxs_args["softmax_label"] = mx.nd.empty(label_shape, ctx)
exector = fcnxs.bind(ctx, fcnxs_args ,args_grad=None, grad_req="null", aux_states=fcnxs_args)
exector.forward(is_train=False)
output = exector.outputs[0]

What does output mean? the softmax loss output or the first layers output? If not softmax loss output,how can i get it?

liumilan avatar Jul 14 '16 08:07 liumilan

It's softmax activation. You can compute log likelihood using activation and label

piiswrong avatar Jul 14 '16 08:07 piiswrong

i got it now ,thanks

liumilan avatar Jul 14 '16 10:07 liumilan

I found that the GPU memory usage increase in the line: exector = fcnxs.bind(ctx, fcnxs_args ,args_grad=None, grad_req="null", aux_states=fcnxs_args) but it seems that the GPU memory is not released, is there any way to address the problem? Also, I wonder where the feature maps stored.

KeLipeng avatar Apr 06 '17 15:04 KeLipeng

Regarding bind(), the memory is expected to increase, as MXNet is building computation graph based on symbols and allocating resources for it.

On 2017年4月6日, at 08:24, KeLipeng [email protected] wrote:

I found that the GPU memory usage increase in the line: exector = fcnxs.bind(ctx, fcnxs_args ,args_grad=None, grad_req="null", aux_states=fcnxs_args) but it seems that the GPU memory is not released, is there any way to address the problem? Also, I wonder where the feature maps stored.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

eric-haibin-lin avatar Apr 06 '17 16:04 eric-haibin-lin

What confused me is the way MXNet allocating GPU memory, I was running a fcnxs example, and found that it use 777MB to store the weights/bias params, and 528 to store the gradient, but when I run the bind() function, it use another 862MB GPU memory. I looked into the exector, and found that it stores the weight/bias params and the gradient params and they share the same id with the network params and gradient, so what does the extra 862MB GPU memory store? Does It store the feature maps? If so, how can I check the feature maps?

KeLipeng avatar Apr 07 '17 14:04 KeLipeng