Skip to content Skip to sidebar Skip to footer

Eclipse+pydev Can't Find Cuda Library For Tensorflow

I am trying to debug some computer vision code (say dcgan) built on top of tensorflow. I installed the tf_0.10 in virtualenv (say, py1) and I use eclipse+pydev as the IDE. The prob

Solution 1:

Can you run it from the command line? If not, that'd be the first step, if you already can, my suggestion is starting Eclipse from that same shell and then checking if all environment variables when you launch it match the ones from the shell.

As a note, the PYTHONPATH is a special variable in PyDev made up from the files you add in the interpreter and in source folders in projects, so, to check the PYTHONPATH my suggestion is creating a program with:

import sys
print('\n'.join(sorted(sys.path)))

and run that from the command line and from inside Eclipse to compare what may be different (and fix the configuration on PyDev accordingly).

Also, after it works in the command-line, it may be nice launching Eclipse from that same shell (so that it will inherit all the env vars you defined in that shell, which may save you time from having to check many other env vars which may be important too).

Solution 2:

I ran into a similar problem where my GPU was successfully accessed by tensorflow on the command line but not eclipse. I have 2 things to try to resolve this sitation.

  1. Restart Eclipse - If changes have been made to the paths since you last opened eclipse, it may simply have a stale view of the environment

  2. Within Runtime Configurations, set the necessary environment variables, in particular CUDA_PATH, to force location of the correct current path, especially if you may have multiple versions of CUDA lying around.

Your current status can be checked with:

import osprint(os.environ)

However, please note that in situation 1 where eclipse is stale, you may still get the correct environment variables printed out, even if eclipse is not aware of the current state of affairs.

Post a Comment for "Eclipse+pydev Can't Find Cuda Library For Tensorflow"