jimxinbo / multilabel-layer-mxnet

This is a multilabel classification layer for mxnet.
12 stars 8 forks source link

Error while compilation of mxnet #3

Open salonip opened 8 years ago

salonip commented 8 years ago

Your API seems to be exactly what I have been looking for. Just one tiny problem! MXNet is getting terminated during compilation with following error make: * [build/src/operator/softmax_multilabel_output.o] Error 1 make: * Waiting for unfinished jobs.... src/operator/softmax_multilabel_output.cu:8:48: fatal error: ./bx_softmax_multilabel_output-inl.h: No such file or directory

include "./bx_softmax_multilabel_output-inl.h"

                                            ^

compilation terminated.

What I am doing wrong?what file is bx_softmax_multilabel_output-inl.h?

jimxinbo commented 8 years ago

@salonip Oh, this is a stupid mistake I made because I renamed my files.

Could you please rename "softmax_output.h" as "softmax_multilabel_output.h" and in both softmax_multilabel.cc and softmax_multilabel.cu, please change

include "./bx_softmax_multilabel_output-inl.h" to #include "./softmax_multilabel_output-inl.h"

Let me know if this fix your problem. Thanks.

jimxinbo commented 8 years ago

sorry, rename "softmax_output.h" as "softmax_multilabel_output-inl.h" change the name in .cc and .cu files accordingly.

Anyway, I just update these modifications.

salonip commented 8 years ago

Oh !thanks for instant reply.I just checked with you in-case I missed some important renaming or something!Thank you .

salonip commented 8 years ago

sorry I am really dense about cpp so don't know how to resolve this- In file included from src/operator/softmax_multilabel_output.cc:7:0: src/operator/./softmax_multilabel_output-inl.h: In function ‘void mshadow::cuda::SoftmaxMultilabelGradKernel(DstPlan, SrcPlan1, SrcPlan2, mshadow::index_t, mshadow::index_t)’: src/operator/./softmax_multilabel_output-inl.h:200:18: error: ‘blockIdx’ was not declared in this scope const int y = blockIdx.x; ^ src/operator/./softmax_multilabel_output-inl.h:204:33: error: ‘threadIdx’ was not declared in this scope const unsigned xindex = x + threadIdx.x; ^ src/operator/./softmax_multilabel_output-inl.h: In function ‘void mshadow::cuda::SoftmaxMultilabelGrad(mshadow::Tensor<mshadow::gpu, 2, DType>&, const mshadow::Tensor<mshadow::gpu, 2, DType>&, const mshadow::Tensor<mshadow::gpu, 2, DType>&)’: src/operator/./softmax_multilabel_output-inl.h:234:18: error: ‘kBaseThreadNum’ was not declared in this scope dim3 dimBlock(kBaseThreadNum); ^ src/operator/./softmax_multilabel_output-inl.h:238:63: error: there are no arguments to ‘CheckLaunchParam’ that depend on a template parameter, so a declaration of ‘CheckLaunchParam’ must be available [-fpermissive] CheckLaunchParam(dimGrid, dimBlock, "SoftmaxMultilabelGrad"); ^ src/operator/./softmax_multilabel_output-inl.h:238:63: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) src/operator/./softmax_multilabel_output-inl.h:240:32: error: ‘kBaseThreadBits’ was not declared in this scope SoftmaxMultilabelGradKernel<kBaseThreadBits, DType> ^ src/operator/./softmax_multilabel_output-inl.h:241:8: error: expected primary-expression before ‘<’ token << <dimGrid, dimBlock, 0, stream >> > ^ src/operator/./softmax_multilabel_output-inl.h:241:41: error: expected primary-expression before ‘>’ token << <dimGrid, dimBlock, 0, stream >> > ^ In file included from src/operator/./softmax_multilabel_output-inl.h:11:0, from src/operator/softmax_multilabel_output.cc:7: src/operator/softmax_multilabel_output.cc: At global scope: /home/saloni/.julia/v0.4/MXNet/deps/src/mxnet/dmlc-core/include/dmlc/parameter.h:254:43: warning: ‘mxnet::op::make__SoftmaxMultilabelOutputParamParamManager’ defined but not used [-Wunused-variable] static ::dmlc::parameter::ParamManager &make ## PType ## ParamManager = \ ^ src/operator/softmax_multilabel_output.cc:21:1: note: in expansion of macro ‘DMLC_REGISTER_PARAMETER’ DMLC_REGISTER_PARAMETER(SoftmaxMultilabelOutputParam); ^ In file included from include/mxnet/operator.h:13:0, from src/operator/./softmax_multilabel_output-inl.h:12, from src/operator/softmax_multilabel_output.cc:7: /home/saloni/.julia/v0.4/MXNet/deps/src/mxnet/dmlc-core/include/dmlc/registry.h:218:22: warning: ‘mxnet::op::make_OperatorPropertyReg_SoftmaxMultilabelOutput’ defined but not used [-Wunused-variable] static EntryType & make ## EntryTypeName ## ## Name ## __ = \ ^ include/mxnet/operator.h:533:3: note: in expansion of macro ‘DMLC_REGISTRY_REGISTER’ DMLC_REGISTRY_REGISTER(::mxnet::OperatorPropertyReg, OperatorPropertyReg, name) \ ^ src/operator/softmax_multilabel_output.cc:23:1: note: in expansion of macro ‘MXNET_REGISTER_OP_PROPERTY’ MXNET_REGISTER_OP_PROPERTY(SoftmaxMultilabelOutput, SoftmaxMultilabelOutputProp) ^ make: * [build/src/operator/softmax_multilabel_output.o] Error 1 make: * Waiting for unfinished jobs....

jimxinbo commented 8 years ago

Hmm, seems a big deal. I will look into it soon. Btw, why system are you using ? Did you installed cuda correctly?

salonip commented 8 years ago

yes.,cuda is working for Mocha.jl and Mxnet python,Mxnet julia is still issue for me. I am using Ubuntu 14.04 cuda7.0 GPU GeForce GTX 750 Ti

hariag commented 8 years ago

Hi @jimxinbo @salonip

I think this error msg caused by mxnet version mismatch. mxnet itself changes a lot and @jimxinbo 's code is based on outdated version of mxnet. if possible could you please update your implementation ? I am very interesting about multi-label classification.

janviparikh commented 8 years ago

Hi @jimxinbo @haria I am facing a similar issue and really interested in multi label. Would really appreciate it if a fix or workaround for this could be provided. Thanks

jimxinbo commented 8 years ago

@salonip @haria @janvidpa

Sorry for the late response. I just recompile the latest mxnet with the three files for multilabel included, seems everything works out well.

So I checked online about the issue like "error: ‘blockIdx’ was not declared in this scope const int y = blockIdx.x;". I find the following links might help https://devtalk.nvidia.com/default/topic/469150/-solved-code-not-compiling-for-mysterious-reason/ https://devtalk.nvidia.com/default/topic/526156/code-compile-success-in-windows-but-not-linux-/

Seems it's something related to compilation. Current my code was compiled on Windows and there are not complains. This seems a problem on Linux. I will try to find a Linux server to fix it soon. Meantime, if you find any simple tricks to get around, please let me know. Thanks.

salonip commented 8 years ago

@jimxinbo thanks ! will look it up