DIGITS icon indicating copy to clipboard operation
DIGITS copied to clipboard

Train Caffe Model task failed with error code -9.

Open vipinrai7 opened this issue 9 years ago • 17 comments

Hi I was trying out DIGITS to train a caffe model. I have built caffe using just CPU and running digits-devserver with --config flag. The weird thing was I wasnt asked the options to use Digits with just the cpu even with the flag. After the job is initialised I get the following message.

norm2 needs backward computation.
relu2 needs backward computation.
conv2 needs backward computation.
pool1 needs backward computation.
norm1 needs backward computation.
relu1 needs backward computation.
conv1 needs backward computation.
label_val-data_1_split does not need backward computation.
val-data does not need backward computation.
This network produces output accuracy
This network produces output loss
Network initialization done.
Solver scaffolding done.
Starting Optimization
Solving
Learning Rate Policy: step
Iteration 0, Testing net (#0)
Ignoring source layer train-data
Test net output #0: accuracy = 0.5
Test net output #1: loss = 0.69282 (* 1 = 0.69282 loss)

Please Help.

vipinrai7 avatar Jan 18 '17 16:01 vipinrai7

Please open the caffe_output.log file and look at the last 20 lines or so. You'll probably see an error message in there somewhere.

lukeyeager avatar Jan 18 '17 17:01 lukeyeager

Looked at it. Still cant figure out the problem. I face this with only the AlexNet model. GoogleNet is working fine. I found this line while starting the server.Maybe this can give you some insight.

vipin@vipin-VirtualBox:/usr/share/digits$ sudo ./digits-devserver
cudaRuntimeGetVersion() failed with error #35

The link to the log.caffe_output.log

vipinrai7 avatar Jan 18 '17 18:01 vipinrai7

Check your solver.prototxt and make sure it's not set to use the GPU?

lukeyeager avatar Jan 18 '17 18:01 lukeyeager

Found it. The solver_mode is set to GPU. But which solver.prototxt do I change? There are multiple files corresponding to each model type.

vipinrai7 avatar Jan 18 '17 19:01 vipinrai7

DIGITS should be automatically setting the solver_mode to CPU if no GPUs are detected on your system: https://github.com/NVIDIA/DIGITS/blob/v5.0.0/digits/model/tasks/caffe_train.py#L505-L510

I know this isn't entirely broken because TravisCI works properly, and there are no GPUs on TravisCI build systems.

Do you actually have any GPUs on your system?

lukeyeager avatar Jan 18 '17 19:01 lukeyeager

No GPU's on my system.

vipinrai7 avatar Jan 18 '17 19:01 vipinrai7

Do you have CUDA installed?

lukeyeager avatar Jan 18 '17 19:01 lukeyeager

I cant find it in /proc/drivers/. Is there a better way to check?

vipinrai7 avatar Jan 18 '17 19:01 vipinrai7

dpkg -l | grep cuda
ldconfig -p | grep cuda

lukeyeager avatar Jan 18 '17 19:01 lukeyeager

ResultSet

ii  cuda-cublas-7-5                                       7.5-18                                              amd64        CUBLAS native runtime libraries
ii  cuda-cudart-7-5                                       7.5-18                                              amd64        CUDA Runtime native Libraries
ii  cuda-curand-7-5                                       7.5-18                                              amd64        CURAND native runtime libraries
ii  cuda-ld-conf-7-5                                      1.0.0-3                                             amd64        CUDA 7.5 ld.so.conf files
ii  cuda-license-7-5                                      7.5-18                                              amd64        CUDA licenses
ii  cuda-repo-ubuntu1404                                  7.5-18                                              amd64        cuda repository configuration files

vipinrai7 avatar Jan 18 '17 19:01 vipinrai7

Oh, so you installed all of DIGITS with deb packages? If I remember correctly, when you build Caffe with CUDA support you can't actually use it unless you're on a machine that has a GPU - even if you're not trying to use the GPU for anything. It's a limitation in the design of Caffe.

So, you'll have to rebuild Caffe for yourself and point DIGITS at it. Sorry it took so long to get you there. I didn't realize you were trying to use the deb packages on a non-GPU system.

lukeyeager avatar Jan 18 '17 19:01 lukeyeager

Hi, Could you be a bit more explicit. Or is there a Document or link where I can find the instructions to what you are suggesting. It would be great help. Because when I looked at the solver.prototxt of individual jobs, its showing the solver running in CPU mode.

vipinrai7 avatar Jan 19 '17 10:01 vipinrai7

Right, but you're using a GPU build of caffe, right?

$ ldd `which caffe` | grep cuda
	libcudart.so.8.0 => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudart.so.8.0 (0x00007f02b4c76000)
	libcurand.so.8.0 => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcurand.so.8.0 (0x00007f02ae940000)
	libcublas.so.8.0 => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcublas.so.8.0 (0x00007f02abf90000)
	libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f02881fc000)

A GPU build of Caffe only works on machines which have a GPU installed.

You need to rebuild Caffe. While you're at it, you might as well get DIGITS from source, too.

The instructions for this are linked to in the README: https://github.com/NVIDIA/DIGITS/blob/digits-5.0/docs/BuildDigits.md

lukeyeager avatar Jan 19 '17 18:01 lukeyeager

But why does googlenet work fine?

vipinrai7 avatar Jan 19 '17 19:01 vipinrai7

Hi, I followed your instructions: A new error has cropped up: The output log for the job:

I0122 00:26:20.133675 18648 solver.cpp:261]     Train net output #0: loss = 0.70806 (* 1 = 0.70806 loss)
I0122 00:26:20.136420 18648 sgd_solver.cpp:106] Iteration 0, lr = 0.01
I0122 00:26:33.062487 18648 solver.cpp:479] Snapshotting to binary proto file snapshot_iter_1.caffemodel
terminate called after throwing an instance of 'std::bad_alloc'
what():  std::bad_alloc
*** Aborted at 1485024994 (unix time) try "date -d @1485024994" if you are using GNU date ***
PC: @     0x7ff56ebc8f79 (unknown)
*** SIGABRT (@0x3e8000048d8) received by PID 18648 (TID 0x7ff5709f9a40) from PID 18648; stack trace: ***
@     0x7ff56ebc8ff0 (unknown)
@     0x7ff56ebc8f79 (unknown)
@     0x7ff56ebcc388 (unknown)
@     0x7ff56f1ce535 (unknown)
@     0x7ff56f1cc6d6 (unknown)
@     0x7ff56f1cc703 (unknown)
@     0x7ff56f1cc922 (unknown)
@     0x7ff56f1cce0d (unknown)
@     0x7ff56f1ccea9 (unknown)
@     0x7ff5704eb9f2 caffe::Blob<>::ToProto()
@     0x7ff5703c0f8c caffe::Layer<>::ToProto()
@     0x7ff5704c4d4f caffe::Net<>::ToProto()
@     0x7ff5704e6251 caffe::Solver<>::SnapshotToBinaryProto()
@     0x7ff5704e631d caffe::Solver<>::Snapshot()
@     0x7ff5704e970d caffe::Solver<>::Step()
@     0x7ff5704e9dce caffe::Solver<>::Solve()
@           0x40a953 train()
@           0x40831c main
@     0x7ff56ebb3ec5 (unknown)
@           0x408aed (unknown)
@                0x0 (unknown)

vipinrai7 avatar Jan 21 '17 19:01 vipinrai7

Bad alloc? I wonder if you're running out of system memory.

lukeyeager avatar Jan 23 '17 19:01 lukeyeager

34958034-f4bb735a-f9e4-11e7-8940-a72c5c6fb4d6 34958036-f4f0edb4-f9e4-11e7-9976-66674b1e25d5 caffe_output_log.txt Makefile.config.txt

Hi @lukeyeager I got an error when train models: "Train Caffe Model Error Initialized at 08:32:53 PM (1 second) Running at 08:32:54 PM (1 second) Error at 08:32:55 PM (Total - 2 seconds) ERROR: error code -11 Setting up coverage_loss Top shape: (1) with loss weight 1 Memory required for data: 2451719688 Creating layer cluster "

My Ubuntu 16.04.3 LTS (xenial) Python: 2.7.12 OpenCV: 3.4.0-dev Protobuf:3.5.1 Cuda Tool Kit: v9.1 CuDNN: v7.1 Caffe: caffe-0.15(nvcaffe) My NVIDIA card: GeForce GTX 1070 (8 GB)

I am building an object detection system(vehicle), and I'm using drone images(1280X720, 1920X1080, 4096X2160). When i create dataset, I set Pad image size as 4096(width) and 2160(height). Also I set resize image size as 1280(width) and 720(height).

I will attach my Makefile.config, caffe log and some other files. Currently I'm trying to install digits object recognition system with my models, but I'm failed every time over about 20 times with various errors. I would like to get working as soon as possible. Thank you Ed

edregansolution avatar Jan 17 '18 17:01 edregansolution