51167

eclipse+pydev can't find cuda library for tensorflow

Question:

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 problem is that the debugger can't find the cuda library so I get the error like the following,

<blockquote>

ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory

</blockquote>

On the other hand, the code works correctly on ubuntu command line and py1 in the virtualenv has no problem finding the cuda library.

In my eclipse+pydev setup, I set a py intepreter as py1, by setting <em>eclipse menu->window->preference->intepreters->python intepreter</em> as

/home/zyuan/tensorflowr010/bin/python2.7 (where /home/zyuan/tensorflowr010 is the root of virtualenv)

Also the system PYTHONPATH for the above intepreter is,

/home/zyuan/tensorflowr010/lib/python2.7 /home/zyuan/tensorflowr010/lib/python2.7/lib-dynload /home/zyuan/tensorflowr010/local/lib/python2.7/site-packages /home/zyuan/tensorflowr010/lib/python2.7/site-packages /home/zyuan/tensorflowr010/lib

Then I chose py1 and the intepreter for my computer vision code dcgan,

by setting dcgan -> properities -> pyDev-interpreter/grammer as py1 and add >external Librarie /usr/local/cuda/lib64 on pyDev-PYTHONPATH

Do I miss anything else?

Answer1:

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).

Recommend

  • Const double initialised from Lua
  • Controller Path in ASP.NET-MVC
  • Why is it ambiguous to call overloaded ambig(long) and ambig(unsigned long) with an integer literal?
  • Update SQL MS Access 2010
  • LibGdx GLES2.0 cube texel stretching
  • Scrolling News Ticker Jquery - Issues
  • Jhipster: How to create relationships with User entity using supplied tools?
  • Is there a way to link a linux's thread TID and a pthread_t “thread ID”
  • py4j.protocol.Py4JJavaError when selecting nested column in dataframe using select statetment
  • Motorola barcode scanner SDK events C#
  • Prevent page break in text block with iText, XMLWorker
  • Python 3.2.2, error(scripts to exe)
  • NSIS decompiler
  • Angular2 - Template reference inside NgSwitch
  • How can I run DataNucleus Bytecode Enhancer from SBT?
  • Jquery Knockout: ko.computed() vs classic function?
  • UWP/C# - Issue with AQS and USB Devices
  • How to make JSON.NET deserialize to Microsoft Date Time?
  • pillow imaging ImportError
  • Bypass multiple inheritance in Java
  • wxPython: displaying multiple widgets in same frame
  • Django simple Captcha “No module named fields” error
  • Problem while Building a Setup Project for a windows Service?
  • WPF - CanExecute dosn't fire when raising Commands from a UserControl
  • How to define and use opencv mat of user type
  • one Local Olampyad Questions on Informatic in 2011
  • How to know when stdin is empty if it contains EOF?
  • Deleting and Updating values from a cusrsor adapter
  • Azure Cloud Service Web Role web pages do not load
  • Finding past revisions of files in StarTeam w/ .NET SDK / C#
  • Window Size for Mac application
  • 'TypeError' while using NSGA2 to solve Multi-objective prob. from pyopt-sparse in OpenMDAO
  • Large data - storage and query
  • WOWZA + RTMP + HTML5 Playback?
  • How to set the response of a form post action to a iframe source?
  • How get height of the a view with gone visibility and height defined as wrap_content in xml?
  • Change div Background jquery
  • Qt: Run a script BEFORE make
  • Linking SubReports Without LinkChild/LinkMaster
  • reshape alternating columns in less time and using less memory