Error while installing TF Object Detection API - python

I am trying to install Tensorflow Object Detection API, following those instructions. Everything goes well till the moment I have to run python -m pip install within the models/research directory. It starts collecting and installing the various packages, but when it reaches the installation of tf-models-official, it produces the following error :
ERROR: Cannot install object-detection because these package versions have conflicting dependencies.
The conflict is caused by:
tf-models-official 2.7.0 depends on tensorflow-addons
tf-models-official 2.6.1 depends on tensorflow-addons
tf-models-official 2.6.0 depends on tensorflow-addons
tf-models-official 2.5.1 depends on tensorflow-addons
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
I did up a bit of digging online, but didn't manage to find anything in the Github repo of tensorflow or other websites. I am using Tensorflow 2.7.0 and Python 3.9.2, on a Linux 64-bit OS. I also tried with Python 3.7.12 but the same error persisted, while manual installation of tensorflow-addons using pip install indicates that no matching distribution was found.

python-3.10.2-amd64: error
python-3.9.10-amd64: ok
python-3.9.2-amd64: ok
python-3.8.10-amd64: ok
python -m pip install --use-feature=2020-resolver tensorflow
'--use-feature=2020-resolver' could be a good solution.
Did you use "tensorflow==2.5.0"?
Don't use specific version like "==2.5.0".
UPDATE
See https://pypi.org/project/tensorflow/#history
tensorflow 2.8.0 (Feb 3, 2022)
I installed tf 2.7.0 and then when I tried to install object detection, tf was reinstalled into tf 2.8.0. So I thought it is weird but I didn't know that tf 2.8.0 doesn't exist yet when you tried to install object detection.
If you try again, tf will be reinstalled automatically into 2.8.0.

Related

Trouble installing keras

I have a problem with keras; I've installed it once but somehow I cannot import it anymore since I recently installed some other packages. If I want to import keras, I get the following error (among many other warnings etc.):
ModuleNotFoundError: No module named 'tensorflow.tsl'
I tried to force reinstall both keras and tensorflow but if I want to do this with keras (with the command pip install --force-reinstall keras), I get the following errors
This behaviour is the source of the following dependency conflicts.
tensorflow 2.7.0 requires flatbuffers<3.0,>=1.12, but you have flatbuffers 22.11.23 which is incompatible.
tensorflow 2.7.0 requires keras<2.8,>=2.7.0rc0, but you have keras 2.11.0 which is incompatible.
tensorflow 2.7.0 requires tensorflow-estimator<2.8,~=2.7.0rc0, but you have tensorflow-estimator 2.11.0 which is incompatible.
And if I want to force reinstall tensorflow I get the following error
Could not install packages due to an OSError: [WinError 5] Zugriff verweigert: 'C:\\Users\\PC\\AppData\\Local\\Temp\\pip-uninstall-tbtwxjcv\\core\\_multiarray_tests.cp38-win_amd64.pyd'
Consider using the `--user` option or check the permissions.
I truly have no idea what is happening here; is it possible to delete the packages manually to reinstall them afterwards? Also the simple pip uninstalldoes not work... Initially I installed keras without a virtual environment, i.e. just with `pip install keras', but it worked once at least...
You need to upgrade Tensorflow or downgrade keras
pip install keras==2.8
and do the same for the other two libraries

Python package (tensorflow) displays mismatching versions between pip list and .__version__ output

I suddenly encounter this situation today, all below output is under the same environment.
pip show tensorflow, the output gives:
Name: tensorflow
Version: 1.14.0rc1
But, if I enter python
python
>>> import tensorflow as tf
>>> print(tf.__version__) . It gives:
'1.13.1'
I am sure I am using the same python under the environment I need with pure terminal or in IDE. This is weird, cuz I used to not having this issue. I just installed few other packages these two days, but I believe they have nothing to do with tensorflow. And you can also verify this through pip show tensorflow or pip list output to see the version is 1.14.0rc1. So why when I actually use python, the tensorflow is not loaded properly?
Solved it by the following:
(under the same environment)
pip uninstall tensorflow (in order to reinstall tensorflow the right version)
pip install tensorflow==1.14.0rc1
Note during installing, there is a piece of info from the terminal:
Installing collected packages: tensorflow
Attempting uninstall: tensorflow
Found existing installation: tensorflow 1.13.1
Uninstalling tensorflow-1.13.1:
Successfully uninstalled tensorflow-1.13.1
So it seems like the tensorflow 1.13.1 has been accidentally installed previously, and whenever in a python program import tensorflow, during searching stage, it hits the tensorflow==1.13.1 before finding the 1.14.0rc1 version. Altho pip list only displays tensorflow==1.14.0rc1 but not tensorflow==1.13.1 might also be due to its internal search or duplicated package resolve mechanism.

cannot install tensorflow-text using pip despite having tensorflow 2.0.0-beta1 installed

My tensorflow 2.0.0beta1 runs normally, but I cannot install tensorflow-text using the command pip install tensorflow-text (as described on the tensorflow page). I can find it using pip search tensorflow-text but I am getting an error
ERROR: Could not find a version that satisfies the requirement tensorflow-text (from versions: none)
There are no requirements for this package (i.e. a specific python version).
I am running on windows, using conda, python 3.6.9
Update
The first release candidate of 2.4.0 was published today which features windows wheels for the first time. 2.4.0rc0 on PyPI. Note that only wheels for Python 3.6 and 3.7 are working properly at the moment. Install via e.g.
> py -3.7 -m pip install tensorflow-text==2.4.0rc0
Original answer
At the time of writing this, tensorflow-text is not available for Windows yet.
Windows is something we do wish to add. We've had some difficulties getting a working package though, which is why it is not available yet. The difference between this library and tensorflow-probability is we make use of custom ops written in c++, and building those shared libraries to work well with Tensorflow inside Windows has had issues; plus, the lengthy build times on Windows has made iterating on these issues slow. While the next beta release (this week) will not include Windows, we would like for the next release to include it.
Source.

Autokeras installation with Anaconda

I have problems with installing Autokeras with Anaconda.
I downgraded python to 3.6
I installed pytorch and downgraded to
version 0.4.1
I downgraded numpy to 1.14.5
I installed visual studio C++ build tool
But now I get the error that tensorflow will require max numpy version 1.14.5. but autokeras will upgrade numpy to 1.15.4 and it failed to build the wheel for lws
After every step ther was an error.
Is there a simple, straight forward way to install Autokeras on Annaconda (Win)?
Thanks for your help
I have Windows 10, Anaconda 2019.10 and Python 3.7.5. In my case, I get the error ERROR: No matching distribution found for torch==1.0.1.post2 (from autokeras) on Windows 10 when trying to pip install autokeras as indicated by the official documentation.
Then I try to get the source code from https://github.com/keras-team/autokeras and run python setup.py install. It successfully installs autokeras for me.
I had the same issues, using Windows 10 Pro. I installed VMware Workstation 15 Player, installed lubuntu as the guest OS, installed anaconda onto that, created a conda virtual environment, and was able to install autokeras as per https://autokeras.com/start/ . The autokeras installation gave a numpy version error, but seems to work. This might not be the answer you are looking for.
Another answer you might not be looking for is to use Docker, as per https://autokeras.com/docker/ . Once I'd changed "$(pwd)":/app to "$(pwd):/app" in the example, this also seems to work.

SciPy can't install old version Windows 10

I'm trying to install an older version of SciPy (either 0.16.1 or 0.17.0), but when I try to use pip I get the result:
pip install scipy==0.16.1
I get the following message
Failed building wheel for scipy
So I found the .whl file here https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy but the problem is that the version here is 1.0.1, and I can't seem to find any older ones, even in the SciPy website (there are for linux and mac)
.
.
PS.
I need to use either of this versions because I'm trying to run Theano on a GPU, and the tutorial provided here http://deeplearning.net/software/theano/install_windows.html says this version is a requirement if there is any tutorial that is better and more up-to-date I would be appreciated

Categories