ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

no module named tensorflow even though tensorflow is installed

asked 2022-02-07 20:49:33 -0500

yxtay gravatar image

Hi, I have an issue using tensorflow on my NVIDIA AGX xavier. I need to use tensorflow for a project, and managed to install tensorflow successfully. I managed to verify the installation by importing tensorflow and doing pip3 show tensorflow.

However, when running my program (ROS related program), the program fails with an error saying there is no module named tensorflow.

I've tried exporting python path but that seems to mess with all my other roslaunches. On a separate system I managed to run my program without having to export the python path so I doubt the python path is the issue here. Reinstalling didn't work either.

My system specifications are as follows:

  • Ubuntu 18.04
  • ROS melodic
  • Python 3.6.9
  • Tensorflow version: 2.6.2+nv21.12

Much help is appreciated!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-13 11:34:55 -0500

Mike Scheutzow gravatar image

updated 2022-02-13 11:36:02 -0500

ROS melodic requires python2. I'm told that tensorflow requires python3. These two are fundamentally not compatible.

The easiest way to get python3 in ROS is to upgrade to ubuntu 20.04 and noetic. There are many existing tensorflow questions on this site. Perhaps you should look for those questions to see what others have done?

edit flag offensive delete link more

Comments

I've managed to run tensorflow on another machine with the ubuntu 18.04 and ros melodic, with the exception it is not an embedded platform.

Following this tutorial(http://wiki.ros.org/catkin/T... to create a workspace, I ran this command "$ catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3" to achieve python3 compatibility, but tensorflow still does not run.

Assuming I cannot upgrade to noetic, is there a way to run tensorflow? I suspect the python version ros uses is python2, but i've run the command for python3 compatibility.

yxtay gravatar image yxtay  ( 2022-02-13 21:28:29 -0500 )edit

Question Tools

Stats

Asked: 2022-02-07 20:49:33 -0500

Seen: 107 times

Last updated: Feb 13 '22