tensorflow cnn kernel dead - python

'I am a window10 user
I'm running tensorflow in jupyter notebook, perceptron works fine, but cnn kernel crashes.
I also tried increasing the buffer size, but the kernel keeps crashing.
How do I fix it?'

Related

Jupyter Notebooks predicting always the same class with GPU and pretrained Keras checkpoint

When I predict on a pre-trained VGG16 based checkpoint with load_weights I am always getting the same class and output tensor. This only happens when I use my GPU (I have 2 GPUs).
If, on the other hand, I only use my CPU by setting:
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
I get the expected results.
This happens for me in Jupyter Notebooks, but it does not happen in google colab. In google colab I get accurate results no matter what.
I am using Keras 2.4.3
Tensorfow 2.4.1
CUDA 11.2

Code run in Jupyter Lab uses very different GPU RAM than run as a script

I am training a 3D siamese network in PyTorch. When I run the code from an iPython (v7.15.0) terminal the GPU RAM usage maxes out at 1739M:
When I copy the same code into a Jupyter notebook (in Jupyter Lab v2.1.5) the GPU RAM usage is 10209M:
Jupyter Lab was run from the terminal in the same Python virtual environment.
First, I don't understand why running the script in Jupyter Lab would increase GPU RAM usage by a factor of almost 6.
Second, and related, is there anyway to have Jupyter Lab run in a mode that uses somewhere in the range of 1739M for the GPU RAM? I love the ability to have all the "documentation" around the code and output.
Python version 3.6.9.
Ok, now I realized what the difference was when I run the two.
I have two GPUs on the machine a Quadro M2000 that drives the video and the Titan XP. When I ran JupyterLab on the command line I ran it as jupyter lab, but when I ran iPython I ran it as CUDA_VISIBLE_DEVICES=0 ipython --pylab. Without the CUDA_VISIBILE_DEVICES it gave me warnings about mis-matched GPUS. When I ran in the iPython terminal I saw the warnings previously, but I didn't see them when I ran JupyterLab.
So, it is still odd that the RAM usage on the Titan XP would jump to 10G+ of RAM.

Training Keras models in two seperate juypter notebooks on CPU and GPU

I am training Keras CNN models for two different applications on the Jupyter Notebook. Given that I want to utilize the full resources of my PC, can I use Keras-GPU in one notebook and another notebook using CPU.
I learned that Keras uses GPU by default - if available- and I can force Keras to use CPU as
in Can Keras with Tensorflow backend be forced to use CPU or GPU at will?. My question is that by running this line of code,
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
will the default settings change in all the running notebooks or in that particular notebook only?
by running this line of code,
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
the default settings change in that particular notebook only
You can use
os.environ['CUDA_VISIBLE_DEVICES'] = ''
to train on CPU

When using tensorflow and numpy in one notebook: The kernel appears to have died. It will restart automatically

When I try to run code using keras and numpy or keras and Matplotlib in one Jupyter notebook I always get the message: The kernel appears to have died. It will restart automatically.
When I run the code in two different notebooks it works perfectly fine. I have installed it using anaconda and I am using macOS. I would really appreciate an answer, everything else I've found and tried so far did not work. Thank you!

Run Tensorflow on Jupyter notebook but kernel dead

I want to train a 5 Layer DNN using Tensorflow on Jupyter Notebook. It perform well on normal training.
But when I want to use Cross validation to find a great dropout rate. When training process, Jupyter say the kernel is dead.
The Jupyter log:
terminate called after throwing an instance of 'std::system_error'
what(): Resource temporarily unavailable
My code is here.
I Google find out maybe it's because run out of memory. I try to reduce batch size and the error still occurred.
The code running on Ubuntu 16.04 and 32GB RAM with GPU 1080Ti. Enviroment are Python(3.5), tensorflow (1.3.0) & tensorflow-gpu (1.3.0).

Categories

Resources