Closed agentmorris closed 1 year 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.
(Comment originally posted by maxogden)
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
(Comment originally posted by maxogden)
@zarrarrabid, the same commands should work on Windows, but... when this issue was opened in 2021, MegaDetector required TensorFlow. Since the release of MegaDetector v5 in 2022, you only need TensorFlow for running old versions of MegaDetector, so my first question would be... are you sure you want to install TensorFlow at all?
I couldn't install tensorflow using the readme instructions:
But after some googling this method worked for me:
Issue cloned from Microsoft/CameraTraps, original issue posted by maxogden on Jan 15, 2021.