Jupyter notebook not pointing to Anaconda


(Atul) #1

All
I have a basic question about setup.
My Jupyter notebook is not pointing to the Anaconda installation, but to the python 3.5 installation that i have. I dont know how to make it to point to the Anaconda installation and Im not able to run my code on the GPU in my laptop

I also have Pycharm in which I can change my interpreter from Python 3.5 to Anaconda and when i do I’m able to run the code on the GPU on my laptop

So Question is how to make Jupyter notebook point to the Anaconda installation.
Thanks


(David Gutman) #2

which python

If wrong one is default, add your anaconda bin path to the front of your $PATH environment variable.

Or just specify exactly which python to use when running jupyter, e.g.:

/home/sigmoid/anaconda/bin/jupyter notebook


(Anand Saha) #3

You may try this:

Once you are in your conda env, run the command

jupyter kernelspec list

This will show you your current registered kernels. For e.g. for me it shows

Available kernels:
  python3    /home/as/anaconda3/envs/tf/share/jupyter/kernels/python3

Now you might have just one kernel like me. Navigate to the folder shown in the listing, open the kernel.json file, and edit the path of python to your desired one. In my case, for e.g. I have pointed the path to the python binary of my appropriate environment.

{
 "argv": [
  "/home/as/anaconda3/envs/tf/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3",
 "language": "python"
}

Now, if you have two or more, I do not know how to make one of them the default. Anyone?

Also note that if you have two or more kernels installed, you can change them in your notebook from the menu:

More on kernels here.

-Anand


(Atul) #4

thanks i was able to get conda env on my jupyter notebook. But still im able to hit local GPU through pycharm program. Same program on Jupyter notebook cant hit GPU

What could i be doing wrong ?


(Atul) #5

getting error

nvcc fatal : Cannot find compiler ‘cl.exe’ in PATH


(Atul) #6

Was able to resolve issue by placing .theanorc file in home directory.
Able to hit GPU on my laptop !!!

After running lesson1 code in notebook , getting below issue which i did not get after running in pycharm

RuntimeError: GpuCorrMM failed to allocate working memory of 576 x 50176

Apply node that caused the error: GpuCorrMM{valid, (1, 1), (1, 1)}(GpuContiguous.0, GpuContiguous.0)
Toposort index: 134
Inputs types: [GpuArrayType(float32, (False, False, False, False)), GpuArrayType(float32, (False, False, False, False))]
Inputs shapes: [(64, 64, 226, 226), (64, 64, 3, 3)]
Inputs strides: [(13075456, 204304, 904, 4), (2304, 36, 12, 4)]
Inputs values: [‘not shown’, ‘not shown’]
Outputs clients: [[GpuElemwise{Composite{(i0 * ((i1 + i2) + Abs((i1 + i2))))}}[(0, 1)](GpuArrayConstant{[[[[ 0.5]]]]}, GpuCorrMM{valid, (1, 1), (1, 1)}.0, InplaceGpuDimShuffle{x,0,x,x}.0)]]

HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. This can be done with by setting the Theano flag ‘optimizer=fast_compile’. If that does not work, Theano optimizations can be disabled with ‘optimizer=None’.
HINT: Use the Theano flag ‘exception_verbosity=high’ for a debugprint and storage map footprint of this apply node.


(Atul) #7

reducing batch size to 32 resolved the issue !!


(Anand Saha) #8

I think the main purpose of the batch size parameter is to remind us how less of GPU RAM we have :joy:


(Atul) #9

I know, I have a 4 GB GPU, but its not enough !!


(Raaj) #10

My jupyter inside fastai venv is pointing to default anaconda location. How do I make it point to fastai


(Raaj) #11

Please help me here. How can I make my jupyter notebook point towards the fastai env and not the anaconda env?