microsoft / CameraTraps

PyTorch Wildlife: a Collaborative Deep Learning Framework for Conservation.
https://cameratraps.readthedocs.io/en/latest/
MIT License
781 stars 246 forks source link

Error installing tensorflow 1.13.1 #232

Closed max-mapper closed 3 years ago

max-mapper commented 3 years ago

I couldn't install tensorflow using the readme instructions:

$ pip install tensorflow==1.13.1
ERROR: Could not find a version that satisfies the requirement tensorflow==1.13.1 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.2.2, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1, 2.3.2, 2.4.0rc0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4, 2.4.0)
ERROR: No matching distribution found for tensorflow==1.13.1

But after some googling this method worked for me:

python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.13.1-py3-none-any.whl
max-mapper commented 3 years ago

Oh wait maybe that didn't work... I get ELF errors when trying to use it:

$ python run_tf_detector.py md_v4.1.0.pb --image_file ~/Desktop/100MEDIA/DSCF0004.JPG 
Fontconfig error: Cannot load default config file
Traceback (most recent call last):
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/opt/anaconda/lib/python3.8/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/opt/anaconda/lib/python3.8/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /home/max/.local/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: invalid ELF header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run_tf_detector.py", line 70, in <module>
    import tensorflow as tf
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/max/.local/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/opt/anaconda/lib/python3.8/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/opt/anaconda/lib/python3.8/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /home/max/.local/lib/python3.8/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: invalid ELF header

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
max-mapper commented 3 years ago

Oh that is because the link above is for the mac version. When I installed Anaconda I got python 3.8 but apparently there is no supported release of tensorflow 1.13.1 for python 3.8, so I did:

conda create -n py37 python=3.7 pip tensorflow
conda activate py37

and now pip install tensorflow==1.13.1 works

Zarrarabid commented 1 year ago

for windows should we use same command i am using vs code

websasindu commented 1 year ago

conda activate py37

This save me!

Lukrisum commented 1 year ago

Oh that is because the link above is for the mac version. When I installed Anaconda I got python 3.8 but apparently there is no supported release of tensorflow 1.13.1 for python 3.8, so I did:

conda create -n py37 python=3.7 pip tensorflow
conda activate py37

and now pip install tensorflow==1.13.1 works

nice bro

aiwithhamza commented 6 months ago

Dear brother I need to create the conda environment for python=3.7; tensorflow=1.13.1 and tensorforce=0.4.2. The above method is working for tensorflow but not for tensorforce. Looking for urgent help and suggestion.

aiwithhamza commented 6 months ago

Oh that is because the link above is for the mac version. When I installed Anaconda I got python 3.8 but apparently there is no supported release of tensorflow 1.13.1 for python 3.8, so I did:

conda create -n py37 python=3.7 pip tensorflow
conda activate py37

and now pip install tensorflow==1.13.1 works

Hello Max thanks this is working. But along with this I need tensoforce==0.4.2 Any idea please.

alsnothome commented 6 months ago

I need tensorforce==0.4.2 Any idea please.

If you manually download and open the tensorforce==0.4.2 package from pypi.org and read the README.md the install process is different to recent versions:

To install TensorForce with tensorflow (cpu), use:

# PyPI install
pip install tensorforce[tf]

# Local install
pip install -e .[tf]

To install TensorForce with tensorflow-gpu (gpu), use:

# PyPI install
pip install tensorforce[tf_gpu]

# Local install
pip install -e .[tf_gpu]

Are you using this with the megadetector models?

aiwithhamza commented 6 months ago

onda create -n py37 python=3.7 pip tensorflow

Dear I am using this for my Openfoam-6 based DRL project. But facing issues related to project setup. I am using Ubuntu 18.04 LTS OpenFOAM-6 tensorflow==1.13.1 tensorforce==0.4.2

for this I need project setup. Struggling from last seven days

aiwithhamza commented 6 months ago

I need tensorforce==0.4.2 Any idea please.

If you manually download and open the tensorforce==0.4.2 package from pypi.org and read the README.md the install process is different to recent versions:

To install TensorForce with tensorflow (cpu), use:

# PyPI install
pip install tensorforce[tf]

# Local install
pip install -e .[tf]

To install TensorForce with tensorflow-gpu (gpu), use:

# PyPI install
pip install tensorforce[tf_gpu]

# Local install
pip install -e .[tf_gpu]

Are you using this with the megadetector models?

As like tensorflow is there any wheel for tensorforce=0.4.2 ??

VpkPrasanna commented 6 months ago

ip install tensorflow==1.13.1

for python 3.6 ? it is not working .

aiwithhamza commented 6 months ago

ip install tensorflow==1.13.1

for python 3.6 ? it is not working . For python 3.7 it is working

uday667 commented 5 months ago

python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.13.1-py3-none-any.whl

Abosultely it's work for me thank you so much

image