title: tensorflow2.1 inside docker report OOM when creating tf.Variable
body: <p>I am new to docker tensorflow2.1. 
  Below works:</p>
  
  <pre><code>docker run --gpus all -it --rm tensorflow/tensorflow:latest-gpu-py3 \
  python -c "import tensorflow as tf; print(tf.__version__)"
  &gt; 2.1.0
  </code></pre>
  
  <p>But this one reports OOM:</p>
  
  <pre><code>docker run --gpus all -it --rm tensorflow/tensorflow:latest-gpu-py3 python -c "import tensorflow as tf; x = tf.Variable([1, 2])"
  2020-03-24 14:29:34.751582: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libnvinfer.so.6
  2020-03-24 14:29:34.771627: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libnvinfer_plugin.so.6
  2020-03-24 14:29:35.680313: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
  2020-03-24 14:29:35.699963: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
  2020-03-24 14:29:35.700510: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties: 
  pciBusID: 0000:06:00.0 name: GeForce MX250 computeCapability: 6.1
  coreClock: 1.582GHz coreCount: 3 deviceMemorySize: 1.96GiB deviceMemoryBandwidth: 52.21GiB/s
  2020-03-24 14:29:35.700557: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
  2020-03-24 14:29:35.700588: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
  2020-03-24 14:29:35.710006: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
  2020-03-24 14:29:35.714535: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
  2020-03-24 14:29:35.740218: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
  2020-03-24 14:29:35.741996: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
  2020-03-24 14:29:35.742047: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
  2020-03-24 14:29:35.742147: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
  2020-03-24 14:29:35.742420: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
  2020-03-24 14:29:35.742610: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0
  2020-03-24 14:29:35.743760: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
  2020-03-24 14:29:35.783886: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2299965000 Hz
  2020-03-24 14:29:35.784691: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4290980 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
  2020-03-24 14:29:35.784711: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
  2020-03-24 14:29:35.799242: W tensorflow/compiler/xla/service/platform_util.cc:276] unable to create StreamExecutor for CUDA:0: failed initializing StreamExecutor for CUDA device ordinal 0: Internal: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_OUT_OF_MEMORY: out of memory; total memory reported: 2099904512
  2020-03-24 14:29:35.799379: I tensorflow/compiler/jit/xla_gpu_device.cc:136] Ignoring visible XLA_GPU_JIT device. Device number is 0, reason: Internal: no supported devices found for platform CUDA
  2020-03-24 14:29:35.799615: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
  2020-03-24 14:29:35.799825: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties: 
  pciBusID: 0000:06:00.0 name: GeForce MX250 computeCapability: 6.1
  coreClock: 1.582GHz coreCount: 3 deviceMemorySize: 1.96GiB deviceMemoryBandwidth: 52.21GiB/s
  2020-03-24 14:29:35.799854: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
  2020-03-24 14:29:35.799866: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
  2020-03-24 14:29:35.799890: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
  2020-03-24 14:29:35.799909: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
  2020-03-24 14:29:35.799924: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
  2020-03-24 14:29:35.799935: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
  2020-03-24 14:29:35.799948: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
  2020-03-24 14:29:35.800046: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
  2020-03-24 14:29:35.800256: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
  2020-03-24 14:29:35.800430: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0
  2020-03-24 14:29:35.801613: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/variables.py", line 260, in __call__
      return cls._variable_v2_call(*args, **kwargs)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/variables.py", line 254, in _variable_v2_call
      shape=shape)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/variables.py", line 235, in &lt;lambda&gt;
      previous_getter = lambda **kws: default_variable_creator_v2(None, **kws)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/variable_scope.py", line 2645, in default_variable_creator_v2
      shape=shape)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/variables.py", line 262, in __call__
      return super(VariableMetaclass, cls).__call__(*args, **kwargs)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/resource_variable_ops.py", line 1411, in __init__
      distribute_strategy=distribute_strategy)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/resource_variable_ops.py", line 1543, in _init_from_args
      name="initial_value", dtype=dtype)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 1314, in convert_to_tensor
      ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/constant_op.py", line 317, in _constant_tensor_conversion_function
      return constant(v, dtype=dtype, name=name)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/constant_op.py", line 258, in constant
      allow_broadcast=True)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/constant_op.py", line 266, in _constant_impl
      t = convert_to_eager_tensor(value, ctx, dtype)
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/constant_op.py", line 95, in convert_to_eager_tensor
      ctx.ensure_initialized()
    File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/eager/context.py", line 509, in ensure_initialized
      context_handle = pywrap_tensorflow.TFE_NewContext(opts)
  tensorflow.python.framework.errors_impl.InternalError: CUDA runtime implicit initialization on GPU:0 failed. Status: out of memory
  </code></pre>