3

I am doing a Docker build in mt computer where NVDIA GPU is not available. I use tensorflow/tensorflow Docker image as the base image with CPU.

Dockerfile

FROM tensorflow/tensorflow 
WORKDIR /project
COPY /app .
RUN python3 main.py

But it shows an error

2020-06-12 20:06:56.822576: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2020-06-12 20:06:56.825090: E tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: UNKNOWN ERROR (303)
2020-06-12 20:06:56.827746: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (735abddf4141): /proc/driver/nvidia/version does not exist
2020-06-12 20:06:56.837312: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-06-12 20:06:57.040593: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2400000000 Hz
2020-06-12 20:06:57.045853: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f377c000b20 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-06-12 20:06:57.045913: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-06-12 20:07:07.017642: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 614400000 exceeds 10% of free system memory.
Killed

at running this code

model = tf.keras.models.Sequential([
                        tf.keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3)),
                        tf.keras.layers.MaxPooling2D(2, 2),
                        tf.keras.layers.Conv2D(64, (3, 3), activation='relu'),
                        tf.keras.layers.MaxPooling2D(2, 2),
                        tf.keras.layers.Conv2D(64, (3, 3), activation='relu'),
                        tf.keras.layers.Flatten(),
                        tf.keras.layers.Dense(128, activation='relu'),
                        tf.keras.layers.Dense(10, activation='softmax')])

I don't want to use GPU version. I need to run this with CPU.

Bumuthu Dilshan
  • 430
  • 5
  • 14

2 Answers2

0

i am using tensorflow serving and meet this problem, and i find TFS dockerfile.gpu base on docker image nvidia/cuda,so, after install nvidia-docker, solved this problem. hope this may help you.

swiftsnail
  • 11
  • 4
-1

As @Dr. snoopy has commented this is a memory error. you should increase the docker memory for example following this post

Areza
  • 5,623
  • 7
  • 48
  • 79
  • Friend a missing file has nothing to do with memory usage - I'm having the same issue with the tensorflow/tensorflow:2.3.1 image without any memory restriction. – hi im Bacon Jan 20 '21 at 10:56
  • @hiimBacon - he is using Docker with CPU - missing file is because he doesn't have driver so automatically switches to CPU - the last line clearly shows the process is killed because of memory. My friend, your downvote didn't bring me any smile – Areza Jan 21 '21 at 20:58