Runs in Jupyter does not run in terminal

I was running tensorrt experiments in a jupyter notebook and it ran, but does not work terminal. This is the error:
2018-06-29 14:54:45.733816: E tensorflow/stream_executor/cuda/cuda_driver.cc:936] failed to allocate 426.03M (446722816 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-06-29 14:54:45.734734: E tensorflow/stream_executor/cuda/cuda_driver.cc:936] failed to allocate 383.42M (402050560 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
2018-06-29 14:54:45.735641: E tensorflow/stream_executor/cuda/cuda_driver.cc:936] failed to allocate 345.08M (361845504 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY
INFO:tensorflow:Starting Warmup cycle
2018-06-29 14:54:46.656900: E tensorflow/stream_executor/cuda/cuda_dnn.cc:455] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
2018-06-29 14:54:46.656978: F tensorflow/core/kernels/conv_ops.cc:713] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo(), &algorithms)
Aborted (core dumped)

really same issue. Have you resolved the problem finally?

Your GPU is out of memory “CUDA_ERROR_OUT_OF_MEMORY”

In order to run in the terminal just shutdown the kernel within your jupyter kernel.
If that doesn’t work run

nvidia-smi

in the terminal. Check the state of your memory, if effectively you are low, then there is a process in the background which might be from jupyter. You could actually figure out what it is or reboot your machine =)