0

I am trying to install Deeplab and run it on my machine. I am following this

I am able to run the initial test 'python3 deeplab/model_test.py' but I am getting

No module named Tensorflow

error while running the next step, sh local_test.sh

Tensorflow is installed on the machine and I have tried with different versions of tensorflow to verify any incompatibility issues. Please suggest on where have I gone wrong and what needs to be done to run it successfully.

This is the error message:

Traceback (most recent call last):
  File "/home/ssindhu/models/research/deeplab/model_test.py", line 18, in <module>
    import tensorflow as tf
ImportError: No module named tensorflow

But tensorflow is installed on the machine: pip show tensorflow has given me the below output.

Name: tensorflow
Version: 1.13.1
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /home/ssindhu/.local/lib/python3.6/site-packages
Requires: six, astor, numpy, protobuf, tensorboard, tensorflow-estimator, termcolor, grpcio, wheel, keras-applications, gast, absl-py, keras-preprocessing
Required-by:
James Z
  • 12,209
  • 10
  • 24
  • 44
Sree
  • 973
  • 2
  • 14
  • 32
  • Make sure you follow the appropriate tutorials for installing TensorFlow and the proper GitHub process for installing deeplab: https://www.tensorflow.org/install/ https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/installation.md – smitty_werbenjagermanjensen Apr 17 '19 at 19:57
  • @JoeA, I believe that I installed all the dependencies as mentioned. I am able to run the quick test successfully, but not the pascalvoc_2012. – Sree Apr 17 '19 at 22:33
  • Hmmmm is Tensorflow installed throughout the system I would try and reinstall it following the proper documentation and same with the deeplab – smitty_werbenjagermanjensen Apr 18 '19 at 12:43

1 Answers1

0

First of all, create a virtual environment

pip install virtualenv
pip3 install virtualenv

Now make a new directory name it enviornments:

sudo mkdir enviornmrnts

Go into this directory (cd enviornments) and activate the environment

virtualenv project1_env
source project1_env/bin/activate

now do this:

pip3 install -U --user pip six numpy wheel setuptools mock
pip3 install -U --user keras_applications==1.0.6 --no-deps
pip3 install -U --user keras_preprocessing==1.0.5 --no-deps


wget "https://github.com/bazelbuild/bazel/releases/download/0.24.0/bazel-0.24.0-installer-darwin-x86_64.sh"

chmod +x bazel-0.24.0-installer-darwin-x86_64.sh
./bazel-0.24.0-installer-darwin-x86_64.sh --user

export PATH="$PATH:$HOME/bin"

check the bazel version by

bazel version

******************************** Installing Tensorflow******************************"

git clone https://github.com/tensorflow/tensorflow.git
git clone https://github.com/tensorflow/models.git

After this:

pip3 install -U tensorflow==1.8.0

To check your installation use this:

cd models/research
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
cd object_detection/
python3 builders/model_builder_test.py
Ajinkya
  • 1,797
  • 3
  • 24
  • 54