Git Product home page Git Product logo

Comments (16)

jkjung-avt avatar jkjung-avt commented on August 13, 2024 4

Just for reference. I also encountered this "ModuleNotFoundError: No module named google.protobuf" issue when I tried to installed tensorflow in a virtualenv recently.

The solution I applied to solve the problem is: tensorflow/tensorflow#6341 (comment). That is, find whether the "google.protobuf" python module is installed and delete the google/__init__.py file.

from jetson_nano.

anilsathyan7 avatar anilsathyan7 commented on August 13, 2024 3

I faced similar issue with latest jetpack 4.3 on my jetson tx2 on tf 2.1 insatllation from nvidia doc.
I installed protobuf 3.8.0(C++) using your script since i faced loading time issue.
But after installation it showed : ModuleNotFoundError: No module named 'google.protobuf.
I uninstalled it and tried with the corresponding python version and it worked without any issue. Still, there was loading time issue with tf-trt ...

The python protobuf default path was : /usr/local/lib/python3.6/dist-packages/google/
C++ version has path : /usr/local/lib/python3.6/dist-packages/protobuf-3.8.0-py3.6-linux-aarch64.egg/google

So once you uninstall python protobuf ,just copy all the data in the later path(google) to former one(google).

Now the loading time is just couple of seconds and your script seems to work with latest jetpack 4.3 +tf2.1 as well...
Just modify the path as required ...

from jetson_nano.

jkjung-avt avatar jkjung-avt commented on August 13, 2024

Could you provide more information about the issue?

  • Which script were you executing when you encountered this issue?
  • Were you running the script on a Jetson Nano or other platforms?

from jetson_nano.

JVTEAM avatar JVTEAM commented on August 13, 2024

Tensorflow 2.0 on Jetson nano. Latest jetpack.

from jetson_nano.

jkjung-avt avatar jkjung-avt commented on August 13, 2024

Please refer to my Building TensorFlow 2.0.0 on Jetson Nano post.

I would install protobuf-3.8.0 before building tensorflow-2.0.0.

from jetson_nano.

JVTEAM avatar JVTEAM commented on August 13, 2024

How do I remove the install and start over?

from jetson_nano.

jkjung-avt avatar jkjung-avt commented on August 13, 2024
$ sudo pip3 unsinstall tensorboard tensorflow-estimator tensorflow
$ rm -rf ${HOME}/src/protobuf-3.8.0
$ rm -rf ${HOME}/src/tensorflow-2.0.0
$ cd ${HOME}/project/jetson_nano
$ ./install_protobuf-3.8.0.sh
$ ./install_bazel-0.26.1.sh      # in case you haven't installed this
$ ./install_tensorflow-2.0.0.sh

from jetson_nano.

JVTEAM avatar JVTEAM commented on August 13, 2024

Did the fixes you suggested....still failed.

ERROR: /root/src/tensorflow-2.0.0/tensorflow/python/keras/api/BUILD:13:1: Executing genrule //tensorflow/python/keras/api:keras_python_api_gen failed (Exit 1)
Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/c947dfdeac38de357c082f7627564630/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen.runfiles/org_tensorflow/tensorflow/python/tools/api/generator/create_python_api.py", line 27, in
from tensorflow.python.tools.api.generator import doc_srcs
File "/root/.cache/bazel/_bazel_root/c947dfdeac38de357c082f7627564630/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen.runfiles/org_tensorflow/tensorflow/python/init.py", line 52, in
from tensorflow.core.framework.graph_pb2 import *
File "/root/.cache/bazel/_bazel_root/c947dfdeac38de357c082f7627564630/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen.runfiles/org_tensorflow/tensorflow/core/framework/graph_pb2.py", line 7, in
from google.protobuf import descriptor as _descriptor
ModuleNotFoundError: No module named 'google.protobuf'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 198175.813s, Critical Path: 1404.69s
INFO: 17405 processes: 17405 local.
FAILED: Build did NOT complete successfully

from jetson_nano.

jkjung-avt avatar jkjung-avt commented on August 13, 2024

Could you verify that python3 "protobuf" module has been installed by pip3 show protobuf?

from jetson_nano.

JVTEAM avatar JVTEAM commented on August 13, 2024

This is the output...

Name: protobuf
Version: 3.8.0
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: None
Author-email: None
License: 3-Clause BSD License
Location: /usr/local/lib/python3.6/dist-packages/protobuf-3.8.0-py3.6-linux-aarch64.egg
Requires: six, setuptools
Required-by: uff

from jetson_nano.

jkjung-avt avatar jkjung-avt commented on August 13, 2024

The output is as expected. protobuf-3.8.0 for python3 has been installed.

You should be able to do import google.protobuf in python3, right?

I wonder why you got this error: ModuleNotFoundError: No module named 'google.protobuf', when building tensorflow-2.0.0...

from jetson_nano.

JVTEAM avatar JVTEAM commented on August 13, 2024

not sure. I'm going to build the lower version for now as I need to get my project back online, but I'm planning on upgrading the jetpack on my other nano so I'll start fresh again there.

only thing i can think of is the script is calling for it via a different version of python.

from jetson_nano.

JVTEAM avatar JVTEAM commented on August 13, 2024

FYI, tried the lower build... Failed very quickly. I just went and did the one on the Nvidia site and that worked. I liked the design but the script just didn't work for me.

from jetson_nano.

jkjung-avt avatar jkjung-avt commented on August 13, 2024

I'm sorry to hear that my script didn't work for you, but definitely glad to know that you got the problem resolved anyway.

If I'm able to reproduce the problem later on, I would do my best to fix the issue.

from jetson_nano.

jkjung-avt avatar jkjung-avt commented on August 13, 2024

Thanks again for sharing this.

from jetson_nano.

priyanksharma7 avatar priyanksharma7 commented on August 13, 2024

Just for reference. I also encountered this "ModuleNotFoundError: No module named google.protobuf" issue when I tried to installed tensorflow in a virtualenv recently.

The solution I applied to solve the problem is: tensorflow/tensorflow#6341 (comment). That is, find whether the "google.protobuf" python module is installed and delete the google/init.py file.

For example, if the virtual environment is called cv, run the following commands:
cd ~/cv/lib/python3.6/site-packages/protobuf-3.17.3-py3.6-linux-aarch64.egg/google/
rm __init__.py

I am using:
JetPack - 4.5.1
Tensorflow - 2.5.0
protobuf - 3.17.3

from jetson_nano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.