microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.53k stars 4.28k forks source link

Errors when trying to build CTNK. No rule to make target: onnx-ml.pb.o #3564

Open senatorbard opened 5 years ago

senatorbard commented 5 years ago

I am attempting to build CNTK. I originally installed it the easy through Python Pip. But, I was having errors. After researching the issue online, I concluded that the problem was that my CPU doesn't handle SSE4.1. It only uses SSE2 and SSE4a. (I honestly don't know what this means.) Anyway, I altered the CNTK Makefile SSE tags. So when I try to build CNTK, it doesn't work. In case you are wondering, I have been following the instructions from here: https://docs.microsoft.com/en-us/cognitive-toolkit/setup-cntk-on-linux.

I think this is the error message that is relevant, but I'm not sure. I'm not very knowledgeable about this kind of installation. But I think this is the culprit. Does anyone know the solution?

compiling protobuf Source/CNTKv2LibraryDll/proto/CNTK.proto
=-----------------------------------------------------------=
make[1]: *** No rule to make target '/home/curtis/Repos/cntk/build/release/.build/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/onnxruntime/core/protobuf/onnx-ml.pb.o', needed by '/home/curtis/Repos/cntk/build/release/lib/libCntk.Eval-2.6.so'.  Stop.
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2
bunchofcoders commented 5 years ago

In my case Source/CNTKv2LibraryDll/proto/onnx/onnxruntime was empty. even after updating onnx with following command

git submodule update --init Source/CNTKv2LibraryDll/proto/onnx/onnx_repo

it doesn't update or copy onnxruntime, which is separate repo. I removed onnxruntime directory and then cloned from https://github.com/Microsoft/onnxruntime.git

Buiild went forward..

senatorbard commented 5 years ago

Thanks for your reply. I'm trying your method, but getting the same results. My guess is that I didn't follow your instructions properly.

Where do I find the original onnxruntime directory? When I clone onnxruntime.git do I need to be in a certain directory or do I just run the clone command from the home directory?

Sorry - I can handle typical programming, but, as funny as this may sound, installing software on ubuntu is the most difficult process in the universe for me.

bunchofcoders commented 5 years ago

Hope this helps...

Assuming cloned cntk repo from git is in /cntk in my case (/home/trainer/Repos/cntk) lets call it ${CNTKDIR}

$(CNTKDIR)/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime is supposed to have onnx related source in this directory. As cntk supports onnx. When I checked error, I found that make was failing to find files in this directory. Figured it was not cloned by any previous attempts, I am not sure why, I am relatively new to git. (You can keep following link on github 'cntk/Source/CNTKv2LibraryDll/proto/onnx/onnx_repo' and see its a separate project/repo). Ok, here is what I did:

  1. Delete onnxruntime directory from $(CNTKDIR)/Source/CNTKv2LibraryDll/proto/onnx

cd $(CNTKDIR)/Source/CNTKv2LibraryDll/proto/onnx/ rm -r onnxruntime

  1. Clone onnxruntime repo from git in .../onnx/ directory

    cd $(CNTKDIR)/Source/CNTKv2LibraryDll/proto/onnx git clone https://github.com/Microsoft/onnxruntime.git

  2. Restart build (debug or release whichever you are trying to build)

    cd $(CNTKDIR)/build/release make -j

senatorbard commented 5 years ago

Dude - you are the man. Thanks a million.

rahul-kothari commented 5 years ago

I tried this, but am getting this error:

Makefile:1758: recipe for target '/cntk/build/release/.build/Source/CNTKv2LibraryDll/proto/onnx/ONNXToCNTK.o' failed
make[1]: *** [/cntk/build/release/.build/Source/CNTKv2LibraryDll/proto/onnx/ONNXToCNTK.o] Error 1
make[1]: *** Waiting for unfinished jobs....
rm Source/CNTKv2LibraryDll/tensorboard/tensorboard.pb.cc Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/onnxruntime/core/protobuf/onnx-operators-ml.pb.cc Source/CNTKv2LibraryDll/proto/CNTK.pb.cc Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/onnxruntime/core/protobuf/onnx-ml.pb.cc
make[1]: Leaving directory '/cntk'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

Any ideas?

johalaoui commented 5 years ago

I did it this way.

cd cntk
git submodule update --init Source/CNTKv2LibraryDll/proto/onnx/onnxruntime