import edgetpu.detection.engine ModuleNotFoundError: No module named 'edg - edge-tpu

I have successfully Installed EdgeTPU and Coral according to GoogleCoral https://coral.ai/docs/accelerator/get-started/#2-install-the-pycoral-library
But somehow there is still error: no module named 'edgetpu'
Yes, I've also tried this.
sudo apt-get update
sudo apt-get install python3-edgetpu...
Please see the result below.
######pycoral result##############3
pi#raspy:~/coral/pycoral $ python3
examples/classify_image.py \
--model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
--labels test_data/inat_bird_labels.txt \
--input test_data/parrot.jpg
----INFERENCE TIME----
Note: The first inference on Edge TPU is slow because it includes loading the model into Edge TPU memory.
18.4ms
5.1ms
6.1ms
5.6ms
5.3ms
-------RESULTS--------
Ara macao (Scarlet Macaw): 0.75781
#################################
pi#raspy:~/DeepPiCar/models/object_detection $ python3
code/coco_object_detection.py
**Traceback (most recent call last):
File "/home/pi/DeepPiCar/models/object_detection/code/coco_object_detection.py", line 9, in <module>
import edgetpu.detection.engine
ModuleNotFoundError: No module named 'edgetpu'**
###############################
pi#raspy:~ $ sudo apt-get install python3-edgetpu
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python3-edgetpu : Depends: python3 (< 3.9) but 3.9.2-3 is to be installed
E: Unable to correct problems, you have held broken packages.

Related

Mininet-WiFi and MiniEdit

I am having problem with installing the Mininet Wifi and miniedit.
I tried to install Mininet-Wifi with the following commands:
$ sudo apt-get install git
$ git clone https://github.com/intrig-unicamp/mininet-wifi
$ cd mininet-wifi
$ sudo util/install.sh -Wlnfv
but in the last command I get this following screen:
…
E: Package 'python-pip' has no installation candidate
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip-whl is already the newest version (20.0.2-5ubuntu1.6).
The following package was automatically installed and is no longer required:
libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
pip 9.0.3 from /usr/local/lib/python2.7/dist-packages (python 2.7)
Reading package lists... Done
Building dependency tree
Reading state information... Done
iproute2 is already the newest version (5.5.0-1ubuntu1).
The following package was automatically installed and is no longer required:
libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
cgroup-tools is already the newest version (0.41-10).
The following package was automatically installed and is no longer required:
libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
Installing Mininet-WiFi dependencies
Reading package lists... Done
Building dependency tree Reading state information... Done
Package python-matplotlib is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-matplotlib' has no installation candidate'''
I have already installed matplotlib and for sure python3, pip3 etc.
I have also a problem with miniEdit.
I took this code from:
https://github.com/intrig-unicamp/mininet-wifi/blob/master/examples/miniedit.py
and when I try to run it, it gives me this error:
'''Traceback (most recent call last): File "miniedit.py", line 59, in <module> from mininet.log import info, debug, warn, setLogLevel ModuleNotFoundError: No module named 'mininet' line 59 is: rom mininet.log import info, debug, warn, setLogLevel from mininet.net import VERSION'''
....
What am I missing?
Thanks!

ModuleNotFoundError: No module named 'absl'

I followed instructions (https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html) to install the Tensorflow Object Detection API. I use Anaconda on ubuntu18.4 and all of the steps in the instructions seemed to complete OK.
When I train to train my model with the following command:
python model_main_tf2.py --model_dir=models/my_ssd_resnet50_v1_fpn --pipeline_config_path=models/my_ssd_resnet50_v1_fpn/pipeline.config
I get the following error:
Traceback (most recent call last):
File "model_main_tf2.py", line 31, in <module>
from absl import flags
ModuleNotFoundError: No module named 'absl'
I get the error mentioned in the headline. I would be very thankful if someone could help me with a code example to solve the problem.
You need the absl package; to install it, use either one of the following:
pip install absl-py
or if you are in a Conda environment:
conda install -c anaconda absl-py

No module named tensorflow even after installing with pip

I'm trying to follow this guide to test this new algorithm: https://github.com/lalonderodney/SegCaps
I can't do it in my PC, so i'm using another server with Putty. Now I'm connected with the other server.
First of all I installed TensorFlow as indicates in the guide with :
pip install -r requirements.txt
After I wrote this code: ./main.py segcaps.png
in which segcaps.png is the image that i want to use
Finally I wrote python main.py --data_root_dir data
that is the only required parameter with the directory containing imgs and masks folders.
Now it gives me an error:
ModuleNotFoundError: No module named 'tensorflow.python.framework'
I searched it in the directory tensorflow/python/framework and it exists.
So, i don't know how to solve it. Ideas?
If you have multiple Python versions installed, then you'll (most likely) have multiple pip versions installed too. Make sure that the pip command you use installs the package(s) into the Python version you want it to. It may so happen that the package got installed into python2 but you wanted it in python3.
Since using pip did not install the packages in python3, pip3 is most likely to the PyPI for python3. Try
pip3 install -r requirements.txt
and that should work.
In case you have an EnvironmentError you can try this (bad idea):
pip3 install -r requirements.txt --user
This solves the problem most of the times on standalone machines. I'm not sure about the server; insufficient permissions might block this.
Why is the --user flag a bad idea? Read: What is the purpose “pip install --user …”?
You can use pip show tensorflow to see if it is installed or not.
As for ModuleNotFoundError try uninstalling keras and reinstalling an earlier version by pip install keras==2.1.6

uninstall virtualenv in mac

I try to install tensorflow via virtualenv in mac, the reference is here:
for I have python already, so I install virtualenv by:
sudo pip install --upgrade virtualenv
build a new virtualenv environment in ~/development project/tensorflow, not in ~/tensorflow as is said in the reference:
virtualenv --system-site-packages ~/development project/tensorflow
cd ~/development project/tensorflow
active virtualenv by:
source bin/activate # if use bash,and I choose this line to run
when I am in virtualenv and run this:
(tensorflow)$ pip install --upgrade <$url_to_binary.whl>
it comes out an error:
zsh: parse error near '\n'
then I check here to help solve it
it says that <$url_to_binary.whl> should be replaced by https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl, and I do so. And problem gone.
but, when I try to test tensorflow by cd some dir in tensorflow like:
(tensorflow)$ cd tensorflow/models/image/mnist
the dir is not exist.
so I guess the url I modified cause it, and I try to reinstall virtualenv and tensorflow, to make my install clean.
tensorflow is successfully uninstalled, but when I remove virtualenv, it booms:
Exception: Traceback (most recent call last): File
"/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215,
in main
status = self.run(options, args) File "/usr/local/lib/python2.7/site-packages/pip/commands/uninstall.py",
line 76, in run
requirement_set.uninstall(auto_confirm=options.yes) File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 346,
in uninstall
req.uninstall(auto_confirm=auto_confirm) File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line
754, in uninstall
paths_to_remove.remove(auto_confirm) File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py",
line 115, in remove
renames(path, new_path) File "/usr/local/lib/python2.7/site-packages/pip/utils/init.py", line
267, in renames
shutil.move(old, new) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 303, in move
os.unlink(src) OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION.rst'
I delete dir tensorflow
for now I could not uninstall virtualenv neither install it, but it still exist....that's really wired.
If I run sudo pip install --upgrade virtualenv again, it says:
The directory '/Users/Calvino/Library/Caches/pip/http' or its parent
directory is not owned by the current user and the cache has been
disabled. Please check the permissions and owner of that directory. If
executing pip with sudo, you may want sudo's -H flag. The directory
'/Users/Calvino/Library/Caches/pip' or its parent directory is not
owned by the current user and caching wheels has been disabled. check
the permissions and owner of that directory. If executing pip with
sudo, you may want sudo's -H flag. Requirement already up-to-date:
virtualenv in /usr/local/lib/python2.7/site-packages
My question is that how could I remove virtualenv and tensorflow thoroughly and reinstall them.
I would be very appreciate if anyone could help.
have been two years but anyways yo need to uninstall with >
//Reinstal python 2 or 3 with new SO update
brew update
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
brew reinstall python#3
Reference
then reinstall tensorflow with>
https://www.tensorflow.org/install/pip
Now, you just need to run:
(tensorflow)$ pip install --upgrade tensorflow # for Python 2.7
(tensorflow)$ pip3 install --upgrade tensorflow # for Python 3.n
And remove by: (this is for virtualenv, you change the path, following path also should be changed to ~/development/project/tensorflow)
$ rm -r ~/tensorflow
If you install tensorflow with native pip:
$ pip uninstall tensorflow
$ pip3 uninstall tensorflow
More information: https://www.tensorflow.org/install/install_mac

TensorFlow pip installation issue: cannot import name 'descriptor'

I'm seeing the following error when installing TensorFlow:
ImportError: Traceback (most recent call last):
File ".../graph_pb2.py", line 6, in
from google.protobuf import descriptor as _descriptor
ImportError: cannot import name 'descriptor'
This error signals a mismatch between protobuf and TensorFlow versions.
Take the following steps to fix this error:
Uninstall TensorFlow.
Uninstall protobuf (if protobuf is installed).
Reinstall TensorFlow, which will also install the correct protobuf dependency.
I faced the similar issue, after trial and error, I used the below logic to run the program:
pip install --upgrade --no-deps --force-reinstall tensorflow
This will make sure to uninstall and reinstall the program from fresh. It works!
I would be extra careful before uninstalling/reinstalling other packages such as protobuf. What I think would most likely be the issue is difference in versions. As of writing this, the most recent release of python is 3.7 while tensorflow is only compatible up to 3.6.
If you're using a 3rd party distribution like Anaconda, this can get hidden from you. In this case I would recommend creating a new environment in Anaconda, with python 3.6 and then installing tensorflow: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python
Try this:
pip uninstall protobuf
brew install protobuf
mkdir -p
/Users/alexeibendebury/Library/Python/2.7/lib/python/site-packages
echo 'import site;
site.addsitedir("/usr/local/lib/python2.7/site-packages")' >>
/Users/alexeibendebury/Library/Python/2.7/lib/python/site-packages/homebrew.pth